﻿/* Scoped styling to ensure the component is fully self-contained */
.app-sidebar {
    width: 260px;
    height: 100vh;
    background-color: #fcfcfc;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.03);
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    white-space: nowrap;
    z-index: 1000;
}

/* --- Desktop & Tablet Collapsed State (Only applies > 768px) --- */
@media (min-width: 769px) {
    .app-sidebar.collapsed {
        width: 80px;
    }

        .app-sidebar.collapsed .brand-full {
            display: none;
        }

        .app-sidebar.collapsed .brand-short {
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 20px;
            font-weight: 900;
            font-family: 'Georgia', serif;
            background: linear-gradient(135deg, rgba(101, 208, 158, 0.15), rgba(35, 62, 134, 0.1));
            width: 42px;
            height: 42px;
            border-radius: 10px;
            margin: 0 auto;
            box-shadow: inset 0 2px 4px rgba(255,255,255,0.5);
        }

        .app-sidebar.collapsed .brand-subtitle {
            display: none;
        }

        .app-sidebar.collapsed .text,
        .app-sidebar.collapsed .caret {
            display: none;
        }

        .app-sidebar.collapsed .nav-item {
            padding: 12px 0;
            justify-content: center;
            margin-right: 0;
            border-radius: 0;
        }

            .app-sidebar.collapsed .nav-item.active {
                border-left: 4px solid #65d09e;
            }

            .app-sidebar.collapsed .nav-item .icon {
                margin-right: 0;
            }

        .app-sidebar.collapsed .section-title {
            color: transparent;
            border-top: 1px solid #e2e8f0;
            height: 1px;
            padding: 0;
            margin: 16px 20px 8px 20px;
        }

        .app-sidebar.collapsed .sub-menu {
            display: none !important;
        }

        .app-sidebar.collapsed .quick-actions {
            justify-content: center;
            padding: 8px 0;
        }

            .app-sidebar.collapsed .quick-actions span {
                display: none;
            }
}

.brand-short {
    display: none;
}

.sidebar-header {
    background: #ffffff; /* Clean white to show off the new logo */
    padding: 10px 20px 8px 20px; /* Further decreased top and bottom padding */
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03); /* Softer, more stylish shadow */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 56px; /* Reduced minimum height to make it much tighter */
}

.brand-title {
    margin: 0;
    font-size: 24px; /* Decreased font size */
    font-family: 'Playfair Display', 'Georgia', serif; /* More elegant serif */
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.brand-zielen {
    color: #65d09e;
}

.brand-script {
    color: #233e86;
    font-weight: 900; /* Subtle weight difference for style */
}

.brand-subtitle {
    display: block;
    font-size: 9px; /* Smaller, cleaner subtitle */
    color: #718096;
    font-weight: 700;
    margin-top: 5px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: 2px; /* Increased tracking for premium look */
    text-transform: uppercase;
    opacity: 0.8;
}

.sidebar-content {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Top quick action bar */
.quick-actions {
    background-color: #233e86;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    color: white;
    font-size: 16px;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(35, 62, 134, 0.15);
}

    .quick-actions .save-icon {
        width: 14px;
        height: 14px;
        cursor: pointer;
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s;
    }

        .quick-actions .save-icon:hover {
            transform: scale(1.2) rotate(3deg);
            color: #65d09e;
        }

.section-title {
    font-size: 11px;
    color: #a0aec0;
    text-transform: uppercase;
    padding: 16px 20px 6px 20px;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    color: #4a5568;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-left: 4px solid transparent;
    user-select: none;
    position: relative;
    margin-right: 16px;
    border-radius: 0 8px 8px 0;
}

    .nav-item:hover {
        background-color: rgba(101, 208, 158, 0.1);
        color: #233e86;
        transform: translateX(4px);
    }

    .nav-item.active {
        background-color: rgba(35, 62, 134, 0.06);
        color: #233e86;
        border-left: 4px solid #65d09e;
        box-shadow: none;
        font-weight: 600;
        transform: translateX(0);
    }

        .nav-item.active .icon {
            stroke: #65d09e;
        }

    .nav-item:hover .icon {
        transform: scale(1.1);
    }

    .nav-item .icon {
        width: 18px;
        height: 18px;
        margin-right: 14px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
        transition: stroke 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .nav-item .text {
        flex-grow: 1;
        font-size: 14px;
        font-weight: inherit;
    }

    .nav-item .caret {
        width: 16px;
        height: 16px;
        transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .nav-item.open .caret {
        transform: rotate(180deg);
    }

.sub-menu {
    background-color: transparent;
    border-left: 2px solid #e2e8f0;
    margin-left: 28px;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-5px);
    transform-origin: top;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

    .sub-menu.show {
        max-height: 500px;
        padding-top: 8px;
        padding-bottom: 8px;
        opacity: 1;
        transform: translateY(0);
    }

.sub-item {
    display: flex;
    align-items: center;
    padding: 10px 20px 10px 24px;
    cursor: pointer;
    color: #64748b;
    font-size: 13.5px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

    .sub-item::before {
        content: '';
        position: absolute;
        left: -2px;
        top: 50%;
        transform: translateY(-50%);
        width: 2px;
        height: 0;
        background-color: #65d09e;
        transition: height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .sub-item:hover {
        color: #233e86;
        transform: translateX(4px);
    }

    .sub-item.active {
        color: #233e86;
        font-weight: 700;
        transform: translateX(2px);
    }

        .sub-item.active::before {
            height: 100%;
        }

    .sub-item .icon {
        width: 16px;
        height: 16px;
        margin-right: 12px;
        stroke-width: 1.5;
    }

.preview-content {
    flex-grow: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: padding 0.3s ease;
}

/* --- Mobile Overlay Backdrop --- */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(35, 62, 134, 0.3);
    backdrop-filter: blur(3px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }

/* --- Mobile Responsive Rules (< 768px) --- */
@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        left: -260px; /* Hide completely off-screen */
    }

        .app-sidebar.mobile-open {
            left: 0; /* Slide into view */
            box-shadow: 4px 0 16px rgba(0,0,0,0.1);
        }

    .preview-content {
        padding: 20px;
    }
}
