/* ===================================
   Modern Sidebar Styles
   =================================== */

/* Sidebar Container */
.modern-sidebar {
    background: #fff;
    padding: 1.5rem 1rem;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    border-left: 1px solid #f1f5f9;
    position: sticky;
    top: 0;
}

.modern-sidebar::-webkit-scrollbar {
    width: 6px;
}

.modern-sidebar::-webkit-scrollbar-track {
    background: #f8fafc;
}

.modern-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.modern-sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Logo Section */
.sidebar-logo-wrapper {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f1f5f9;
}

.logo-link {
    display: inline-block;
    transition: transform 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

.front-sidebar-logo {
    width: 80px;
    height: auto;
    transition: all 0.3s ease;
}

/* Search Section */
.sidebar-search-section {
    margin-bottom: 2rem;
}

.modern-search {
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 0.8rem;
}

.search-icon {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    z-index: 2;
    pointer-events: none;
}

.modern-input {
    width: 100%;
    padding: 0.9rem 3rem 0.9rem 3.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-family: 'Rubik', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.modern-input:focus {
    outline: none;
    border-color: #ffdf00;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 223, 0, 0.15);
}

.modern-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.search-submit-btn {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: #ffdf00;
    border: 1px solid #ffdf00;
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-submit-btn svg {
    color: #0b0b0b;
}

.search-submit-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 223, 0, 0.3);
    border-color: #ffdf00;
}

/* Advanced Search Button */
.modern-advanced {
    width: 100%;
    background: #ffdf00;
    color: #0b0b0b;
    border: 2px solid #ffdf00;
    border-radius: 10px;
    padding: 0.8rem 1.2rem;
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modern-advanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 223, 0, 0.3);
    border-color: #ffdf00;
}

.modern-advanced svg {
    transition: transform 0.3s ease;
}

.modern-advanced:hover svg {
    transform: rotate(15deg);
}

/* Navigation Menu */
.sidebar-nav {
    margin-top: 1.5rem;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    font-family: 'Rubik', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    color: #475569;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(255, 223, 0, 0.1) 0%, rgba(255, 223, 0, 0.05) 100%);
    transition: width 0.3s ease;
    border-radius: 12px;
}

.nav-link:hover::before {
    width: 100%;
}

.nav-link:hover {
    color: #d4b800;
    background: rgba(255, 223, 0, 0.05);
    transform: translateX(-3px);
}

.nav-link.active,
.nav-link[aria-current="page"] {
    color: #0b0b0b;
    background: linear-gradient(90deg, rgba(255, 223, 0, 0.25) 0%, rgba(255, 223, 0, 0.1) 100%);
    font-weight: 700;
    border-right: 3px solid #ffdf00;
}

.nav-link.active::before {
    width: 100%;
}

.nav-link.active .nav-icon svg {
    stroke: #d4b800;
    stroke-width: 2.5;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.nav-link:hover .nav-icon {
    transform: scale(1.1);
}

.nav-icon svg {
    transition: stroke 0.3s ease;
}

.nav-link:hover .nav-icon svg {
    stroke: #d4b800;
}

.nav-text {
    flex: 1;
    position: relative;
    z-index: 1;
}

/* Upload Link Special Style */
.upload-link {
    background: linear-gradient(135deg, rgba(255, 223, 0, 0.08) 0%, rgba(255, 223, 0, 0.03) 100%);
    border: 2px solid rgba(255, 223, 0, 0.3);
}

.upload-link:hover {
    background: linear-gradient(135deg, rgba(255, 223, 0, 0.15) 0%, rgba(255, 223, 0, 0.08) 100%);
    border-color: #ffdf00;
}

.upload-link.active {
    background: linear-gradient(135deg, rgba(255, 223, 0, 0.2) 0%, rgba(255, 223, 0, 0.12) 100%);
    border-color: #ffdf00;
    border-right: 3px solid #ffdf00;
}

.upload-icon {
    background: #ffdf00;
    padding: 0.5rem;
    border-radius: 8px;
}

.upload-icon svg {
    stroke: #0b0b0b !important;
}

/* Profile Item */
.profile-item {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f1f5f9;
}

.profile-link {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
}

.profile-link:hover {
    background: linear-gradient(135deg, rgba(255, 223, 0, 0.08) 0%, rgba(255, 223, 0, 0.03) 100%);
    border-color: #ffdf00;
}

.profile-link.active {
    background: linear-gradient(135deg, rgba(255, 223, 0, 0.15) 0%, rgba(255, 223, 0, 0.08) 100%);
    border-color: #ffdf00;
    border-right: 3px solid #ffdf00;
}

.profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.profile-link:hover .profile-avatar {
    border-color: #ffdf00;
    transform: scale(1.05);
}

.user-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar svg {
    width: 20px;
    height: 20px;
}

/* Badge for notifications (optional) */
.nav-item.has-notification .nav-icon::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #fff;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .modern-sidebar {
        width: 20%;
    }

    .front-sidebar-logo {
        width: 140px;
    }
}

@media (max-width: 1200px) {
    .modern-sidebar {
        width: 22%;
    }

    .nav-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 992px) {
    .modern-sidebar {
        width: 100%;
        height: auto;
        border-left: none;
        border-bottom: 1px solid #f1f5f9;
        position: relative;
    }

    .nav-list {
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
    }

    .nav-item {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .nav-link {
        flex-direction: column;
        padding: 0.8rem;
        text-align: center;
        gap: 0.5rem;
    }

    .nav-icon {
        margin-left: 0;
    }

    .nav-text {
        font-size: 0.75rem;
    }

    .profile-item {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }
}

@media (max-width: 768px) {
    .sidebar-logo-wrapper {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .front-sidebar-logo {
        width: 120px;
    }

    .search-input-wrapper {
        margin-bottom: 0.6rem;
    }

    .modern-input {
        padding: 0.75rem 2.5rem 0.75rem 3rem;
        font-size: 0.9rem;
    }

    .modern-advanced {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }
}

/* Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.nav-item {
    animation: slideIn 0.3s ease forwards;
}

.nav-item:nth-child(1) { animation-delay: 0.05s; }
.nav-item:nth-child(2) { animation-delay: 0.1s; }
.nav-item:nth-child(3) { animation-delay: 0.15s; }
.nav-item:nth-child(4) { animation-delay: 0.2s; }
.nav-item:nth-child(5) { animation-delay: 0.25s; }
.nav-item:nth-child(6) { animation-delay: 0.3s; }
.nav-item:nth-child(7) { animation-delay: 0.35s; }

/* ===================================
   Modern Advanced Search Offcanvas
   =================================== */

/* Offcanvas Container */
.modern-search-offcanvas {
    height: auto !important;
    max-height: 98vh !important;
    border-radius: 24px 24px 0 0 !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15) !important;
    z-index: 9999 !important;
    direction: rtl !important;
}

.modern-search-offcanvas ~ .offcanvas-backdrop {
    z-index: 9998 !important;
}

.modern-search-offcanvas .offcanvas-body {
    padding: 0 !important;
}

/* Header */
.modern-search-header {
    background: #f5d300;
    border: none;
    padding: 1.5rem 2rem;
    border-radius: 24px 24px 0 0;
}

.search-header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-header-content svg {
    color: #0b0b0b;
    animation: searchPulse 2s ease-in-out infinite;
}

@keyframes searchPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.modern-search-header .offcanvas-title {
    color: #0b0b0b;
    font-family: 'Rubik', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    margin: 0;
}

.modern-close-btn {
    background: rgba(255, 223, 0, 0.15);
    border: 2px solid rgba(255, 223, 0, 0.4);
    border-radius: 12px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.modern-close-btn svg {
    color: #ffdf00;
    transition: transform 0.3s ease;
}

.modern-close-btn:hover {
    background: rgba(255, 223, 0, 0.3);
    transform: rotate(90deg);
}

.modern-close-btn:hover svg {
    transform: rotate(90deg);
}

/* Body */
.modern-search-body {
    padding: 2rem !important;
    background: #f8fafc;
    overflow-y: auto;
    max-height: calc(98vh - 100px);
}

.modern-search-body::-webkit-scrollbar {
    width: 6px;
}

.modern-search-body::-webkit-scrollbar-track {
    background: transparent;
}

.modern-search-body::-webkit-scrollbar-thumb {
    background: rgba(255, 223, 0, 0.3);
    border-radius: 10px;
}

.modern-search-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 223, 0, 0.5);
}

.modern-search-form {
    background: #fff;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    overflow: visible !important;
}

.search-fields-container {
    margin-bottom: 1.5rem;
    overflow: visible !important;
}

.search-fields-container .row {
    position: relative;
    margin-bottom: 6rem;
    overflow: visible !important;
}

.search-fields-container .row:last-child {
    margin-bottom: 0;
}

.search-fields-container .row > * {
    position: relative;
    z-index: 1;
    margin-bottom: 0;
    overflow: visible !important;
}

/* Form Group */
.modern-form-group {
    margin-bottom: 0;
    position: relative;
    z-index: 1;
    overflow: visible !important;
}

.modern-form-group:focus-within {
    z-index: 100;
}

/* Ensure Select dropdowns appear above everything */
.modern-form-group .css-26l3qy-menu {
    z-index: 9999 !important;
}

.modern-form-group [class*="-menu"] {
    z-index: 9999 !important;
}

.modern-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #1e293b;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.modern-label svg {
    color: #ffdf00;
    flex-shrink: 0;
}

.modern-label span {
    flex: 1;
}

.modern-form-group:hover .modern-label {
    color: #d4b800;
}

.modern-form-group:hover .modern-label svg {
    transform: scale(1.1);
}

/* Actions */
.modern-search-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f1f5f9;
}

.modern-search-submit,
.modern-search-cancel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-family: 'Rubik', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modern-search-submit {
    background: #ffdf00;
    color: #0b0b0b;
    border: 2px solid #ffdf00;
    box-shadow: 0 4px 15px rgba(255, 223, 0, 0.3);
}

.modern-search-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 223, 0, 0.5);
    background: #f5d300;
}

.modern-search-submit:active {
    transform: translateY(0);
}

.modern-search-submit svg {
    transition: transform 0.3s ease;
}

.modern-search-submit:hover svg {
    transform: rotate(15deg) scale(1.1);
}

.modern-search-cancel {
    background: #e2e8f0;
    color: #475569;
}

.modern-search-cancel:hover {
    background: #cbd5e1;
    color: #1e293b;
    transform: translateY(-2px);
}

.modern-search-cancel:active {
    transform: translateY(0);
}

/* Responsive Design for Advanced Search */
@media (max-width: 768px) {
    .modern-search-header {
        padding: 1.2rem 1.5rem;
    }

    .modern-search-header .offcanvas-title {
        font-size: 1.1rem;
    }

    .modern-close-btn {
        width: 36px;
        height: 36px;
        padding: 0.4rem;
    }

    .modern-search-body {
        padding: 1.5rem !important;
    }

    .modern-search-form {
        padding: 1.5rem;
    }

    .search-fields-container .row {
        margin-bottom: 6.5rem;
    }

    .modern-label {
        font-size: 0.9rem;
    }

    .modern-label svg {
        width: 16px;
        height: 16px;
    }

    .modern-search-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .modern-search-submit,
    .modern-search-cancel {
        padding: 0.8rem 1.2rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .modern-search-offcanvas {
        max-height: 98vh !important;
    }

    .modern-search-header {
        padding: 1rem 1.2rem;
    }

    .search-header-content {
        gap: 0.5rem;
    }

    .search-header-content svg {
        width: 20px;
        height: 20px;
    }

    .modern-search-header .offcanvas-title {
        font-size: 1rem;
    }

    .modern-close-btn {
        width: 32px;
        height: 32px;
    }

    .modern-close-btn svg {
        width: 18px;
        height: 18px;
    }

    .modern-search-body {
        padding: 1rem !important;
    }

    .modern-search-form {
        padding: 1.2rem;
    }

    .search-fields-container .row {
        margin-bottom: 7rem;
    }

    .modern-label {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }

    .modern-search-actions {
        margin-top: 1.5rem;
        padding-top: 1.2rem;
    }

    .modern-search-submit,
    .modern-search-cancel {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .modern-search-submit svg,
    .modern-search-cancel svg {
        width: 18px;
        height: 18px;
    }
}

/* Animation for form fields */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modern-form-group {
    animation: fadeInUp 0.4s ease forwards;
}

.modern-form-group:nth-child(1) { animation-delay: 0.1s; }
.modern-form-group:nth-child(2) { animation-delay: 0.2s; }
.modern-form-group:nth-child(3) { animation-delay: 0.3s; }

.modern-search-actions {
    animation: fadeInUp 0.4s ease 0.4s forwards;
    opacity: 0;
}
