/* -------------------------
   Sidebar Section Styling
---------------------------*/

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #9D9D9D;
    text-transform: uppercase;
    padding: 10px 20px 5px 20px;
    border-bottom: 1px solid #333;
    letter-spacing: 0.5px;
}

.sidebar-logo {
    width: 100%;
}

.sidebar-logo img {
    max-width: 160px; /* adjust as needed */
    height: auto;
    display: block;
    margin: 0 auto;
    transition: max-width 0.3s ease; /* smooth resizing */
}

.login-logo img {
    width: 100%; /* fills the wrapper width */
    height: auto;
    display: block;
}

.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #e9ebef, #b7bec4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}


/* Card sizing */
.login-card-wrapper {
    width: 100%;
    max-width: 420px;
}

/* Glassy modern login card */
.login-card {
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.82);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid #333;
}

.logout-btn {
    width: 100%;
    padding-left: 12px;
    padding-right: 12px;
    background: rgb(53, 53, 66) !important;
    border: none;
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.logout-btn:hover {
    background: rgba(255, 120, 120, 0.12) !important;
    padding-left: 28px;
}

.logout-btn i,
.logout-btn span {
    color: #ffffff !important; /* pure white */
    transition: color 0.25s ease;
}

.logout-btn i {
    font-size: 18px;
}

.logout-btn:hover i,
.logout-btn:hover span {
    color: #ff4b4b !important; /* bright red */
}


.current-user {
    display: flex;
    align-items: center; /* vertical center */
    gap: 8px; /* space between icon and username */
    font-size: 14px;
    padding-bottom: 10px;
    padding-left: 12px;
    padding-right: 12px;
}

.current-user i {
    font-size: 22px;
    margin-right: 12px;
}

body.body-layout {
    font-family: Arial, sans-serif;
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #f3f4f7, #b9bfc3);
}

/* -------------------------------
   SIDEBAR
-------------------------------- */
.sidebar {
    width: 240px;
    background: rgba(20, 20, 35, 0.85);
    backdrop-filter: blur(12px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding-top: 20px;
    flex-shrink: 0;
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.3);
    z-index: 50;
}

.sidebar h2 {
    text-align: center;
    margin-bottom: 20px;
    font-weight: 300;
    font-size: 20px;
}

.menu-item {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    font-size: 16px;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    transition: 0.25s ease;
}

.menu-item i {
    margin-right: 12px;
    font-size: 20px;
    color: #4D96FF;
    transition: color 0.3s, transform 0.3s;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.07);
    padding-left: 28px;
}

.menu-item:hover i {
    transform: scale(1.15);
}

/* -------------------------
   Menu Item Label Styling
---------------------------*/
.menu-item span {
    font-size: 15px;
    font-weight: 500;
    color: #E0E0E0; /* lighter text color for contrast */
    transition: color 0.2s ease;
}

/* Change label color on hover */
.menu-item:hover span {
    color: #FFFFFF; /* brighter when hovering */
}

/* Optional: truncate long labels to prevent overflow */
.menu-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------------------------------
   COLOR PICKER (dashboard popup)
-----------------------------------*/
.color-dropdown {
    position: absolute;
    left: 250px;
    top: 0;
    width: 200px; /* breiter */
    background: #3e3535;
    border-radius: 10px;
    border: 1px solid #ccc;
    padding: 10px;
    display: none;
    flex-direction: column; /* ← alles untereinander */
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 9999;
}

.color-option {
    text-align-last: center;
    width: 100%;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.25);
    transition: transform 0.12s ease;
}

.color-option:hover {
    transform: scale(1.04);
}


/* -------------------------------
   MAIN AREA
-------------------------------- */
.main-area {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}


/* -------------------------------
   GRID VIEW (2x2)
-------------------------------- */
.content-grid {
    flex-grow: 1;
    display: grid;
    height: 100%;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    border-left: 2px solid #333;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* Animation class added by JS */
.hide {
    opacity: 0;
    transform: scale(0.97);
}

.square {
    border-radius: 12px;
    background: #ffffff;
    padding: 10px;
    overflow: hidden;
    cursor: pointer;
    position: relative;

    border: 1px solid rgba(0, 0, 0, 0.12); /* Dünn & gestochen scharf */

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), /* Leichter Schatten */ 0 1px 2px rgba(0, 0, 0, 0.04);
}


.square-title {
    position: absolute;
    top: 8px;
    left: 50px;
    z-index: 3;
    font-weight: 600;
    color: #333;
}

.square-svg {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.square-svg svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}


/* -------------------------------
   DETAIL VIEW (Animated)
-------------------------------- */
.detail-view {
    display: none;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    border-left: 2px solid #333;
    padding: 5px;
    flex-grow: 1;
    position: relative;
}

.detail-view.active {
    opacity: 1;
    transform: translateX(0);
}

.detail-back {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #1e1e2f;
    color: white;
    padding: 8px 14px;
    cursor: pointer;
    border-radius: 6px;
    z-index: 3;
}

/* SIMPLE FIX → Title goes right of the back button */
.detail-title {
    position: absolute;
    top: 15px;
    left: 145px;
    font-size: 20px;
    font-weight: 600;
}

.detail-svg-wrapper {
    width: 80%;
    height: 80%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    padding-top: 40px;
}

.detail-svg-wrapper svg {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    margin-top: -15%;
}

/* ----------------------------------
     RESPONSIVE BEHAVIOR WITH ANIMATION
  ---------------------------------- */
/* Tablet: sidebar collapses to icon-only */
@media (max-width: 900px) {
    .sidebar {
        width: 70px;
    }

    .sidebar h2,
    .menu-item span {
        display: none;
    }

    .section-title {
        display: none;
    }

    .menu-item i {
        margin-right: 0;
    }

    .menu-item span {
        display: block;
        position: absolute;
        left: 60px; /* offset from icon */
        background: #1e1e2f;
        padding: 4px 8px;
        border-radius: 4px;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s;
    }

    .menu-item:hover span {
        opacity: 1;
        pointer-events: auto;
    }


    .current-user {
        display: flex;
        justify-content: center; /* center horizontally */
        align-items: center;
        flex-direction: column; /* stack icon above text if needed */
        padding: 10px 0;
    }

    .current-user span {
        display: none; /* hide username text on small screens */
    }

    .current-user i {
        font-size: 22px; /* bigger icon for mini-sidebar */
    }

    .logout-btn i {
        font-size: 22px; /* bigger icon for mini-sidebar */
    }

    .logout-btn:hover {
        padding-left: 0;
        background: rgba(255, 120, 120, 0.18) !important;
    }
}

/* Mobile: sidebar collapses fully (stacked top bar) */
/* Mobile: sidebar collapses fully (stacked top bar) */
@media (max-width: 600px) {
    body {
        flex-direction: column;
    }

    /* Hide title */
    .sidebar h2 {
        display: none !important;
    }

    /* Top bar layout */
    .sidebar {
        flex-direction: row;
        width: 100%;
        height: 60px;
        padding: 0;
        justify-content: space-around;
    }

    .menu-item,
    .logout-btn,
    .current-user {
        position: relative; /* needed for tooltip positioning */
    }

    .content {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        height: calc(100vh - 60px);
    }

    .sidebar-footer {
        padding: 0px;
    }

    /* Icons only — perfectly centered */
    .menu-item,
    .logout-btn,
    .current-user {
        padding: 0 !important;
        margin: 0 !important;
        width: 40px !important;
        height: 60px !important;

        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;

        border-radius: 0;
        overflow: visible !important; /* allow tooltip to extend outside */
    }

    /* Tooltip UNDER icons */
    .menu-item span,
    .logout-btn span,
    .current-user span {
        display: block !important;
        position: absolute;
        bottom: -26px; /* tooltip below icon */
        left: 50%;
        transform: translateX(-50%);
        background: #1e1e2f;
        padding: 4px 8px;
        border-radius: 4px;
        white-space: nowrap;

        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        font-size: 12px;
        z-index: 9999;
    }

    /* Tooltip on hover */
    .menu-item:hover span,
    .logout-btn:hover span,
    .current-user:hover span {
        opacity: 1;
        pointer-events: auto;
    }

    /* Icons centered visually */
    .menu-item i,
    .logout-btn i,
    .current-user i {
        font-size: 22px !important;
        margin: 0 !important;
        transform: none !important;
    }

    /* Hover background */
    .menu-item:hover,
    .logout-btn:hover,
    .current-user:hover {
        background: rgba(255, 255, 255, 0.10) !important;
        width: 40px !important;
        height: 60px !important;
    }

    /* Logout hover */
    .logout-btn:hover {
        background: rgba(255, 80, 80, 0.15) !important;
    }

    .sidebar > * {
        flex: 0 0 auto !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .content {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .sidebar-logo {
        display: none !important;
    }
}


@media (min-width: 601px) and (max-height: 850px) {
    .sidebar {
        display: flex;
        flex-direction: column;
    }

    .sidebar-footer {
        margin-top: auto; /* pushes logout button to bottom */
        flex-shrink: 0; /* NEVER shrink the logout button */
    }

    .sidebar > *:not(.sidebar-footer) {
        flex-shrink: 1; /* all other items may shrink */
    }
}

@media (min-width: 601px) and (max-height: 850px) {

    /* compress menu items vertically */
    .menu-item {
        padding: 4px 12px;
        min-height: 36px; /* allow shrinking */
    }

    .menu-item span {
        font-size: 12px;
    }

    .section-title {
        padding: 4px 12px;
        font-size: 11px;
    }

    .current-user {
        padding: 4px 0;
        font-size: 12px;
    }
}

@media (min-width: 601px) and (max-height: 720px) {
    .menu-item {
        padding: 2px 10px;
        min-height: 32px;
    }

    .menu-item span {
        font-size: 11px;
    }

    .section-title {
        padding: 2px 10px;
        font-size: 10px;
    }

    .current-user {
        padding: 2px 0;
        font-size: 11px;
    }
}

/* 600–900 px width: lock icon sizes permanently */
@media (min-width: 601px) and (max-width: 900px) {

    /* Keep all icons same size as before */
    .menu-item i,
    .logout-btn i,
    .current-user i {
        font-size: 22px !important; /* lock icon size */
        margin-right: 0 !important; /* consistent in collapsed view */
    }

    /* Keep icon centered */
    .menu-item,
    .logout-btn,
    .current-user {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Optional: hide labels (your current 600–900 behavior) */
    .menu-item span {
        opacity: 0;
        pointer-events: none;
        position: absolute;
        left: 60px;
        background: #1e1e2f;
        padding: 4px 8px;
        border-radius: 4px;
        white-space: nowrap;
        transition: opacity 0.2s;
    }

    .menu-item:hover span {
        opacity: 1;
        pointer-events: auto;
    }

    .section-title {
        display: none !important;
    }

    .sidebar-logo {
        display: none;
    }
}


/* ----------------------------------
     Color Picker
  ---------------------------------- */

.detail-color-picker {
    position: fixed;
    display: none;
    background: white;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 999999;
    min-width: 180px;
    border: 1px solid #ddd;
    flex-direction: column;
    gap: 10px;
}

/* Title with gradient line */
.picker-title {
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    padding-bottom: 6px;
    background-image: linear-gradient(to right, rgba(44, 42, 42, 0.08), rgba(44, 42, 42, 0.32), rgba(44, 42, 42, 0.08));
    background-position: bottom;
    background-size: 100% 1px;
    background-repeat: no-repeat;
}

/* stacked list layout (replacing grid) */
.picker-options {
    display: block !important;
}

/* row: circle + label */
.color-choice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 4px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 6px;
}

.color-choice:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* the circle */
.color-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid #ccc;
}


#detailSvgWrapper svg {
    position: relative;
    left: -20%;
}

@media (min-width: 901px) {

    /* Same left padding for both elements */
    .current-user,
    .logout-btn {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

}

.sidebar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-svg {
    width: 35px;
    height: 35px;
    background-color: currentColor; /* <-- color applied dynamically */

    /* mask settings */
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;

    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}


#gridView {
    position: relative;
}

.save-all-btn {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);

    width: 64px;
    height: 64px;
    border-radius: 50%;

    background: rgba(20, 20, 28, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    z-index: 20;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.45);
}

.save-all-btn:hover {
    filter: brightness(1.1);
}

.save-all-btn:active {
    transform: translate(-50%, -50%) scale(0.95);
}


