
    :root {
        --navy: #003366;
        --navy-dark: #002244;
        --navy-light: #004488;
        --gold: #FFD700;
        --gold-dark: #CCAC00;
        --gold-light: #FFE55C;
        --white: #ffffff;
        --gray-50: #f8fafc;
        --gray-100: #f1f5f9;
        --gray-200: #e2e8f0;
        --gray-300: #cbd5e1;
        --gray-400: #94a3b8;
        --gray-500: #64748b;
        --gray-600: #475569;
        --gray-700: #334155;
        --gray-800: #1e293b;
        --gray-900: #0f172a;
        --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
        --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
        --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1);
        --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1);
        --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    }

    * { margin: 0; padding: 0; box-sizing: border-box; }

    body {
        font-family: 'Inter', sans-serif;
        background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
        min-height: 100vh;
    }

    /* Animated Background */
    .animated-bg {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
        z-index: -1;
    }
    
    .animated-bg span {
        position: absolute;
        display: block;
        width: 20px;
        height: 20px;
        background: rgba(0, 51, 102, 0.1);
        bottom: -150px;
        animation: animate 25s linear infinite;
    }

    @keyframes animate {
        0% { transform: translateY(0) rotate(0deg); opacity: 1; }
        100% { transform: translateY(-1000px) rotate(720deg); opacity: 0; }
    }

    /* Main Container */
    .main-container {
        max-width: 1400px;
        margin: 20px auto;
        padding: 0 20px;
    }

    /* Header */
    .library-header {
        background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
        border-radius: 30px;
        padding: 2.5rem;
        margin-bottom: 2rem;
        border: 3px solid var(--gold);
        box-shadow: var(--shadow-xl);
        position: relative;
        overflow: hidden;
    }

    .library-header::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -50%;
        width: 400px;
        height: 400px;
        background: radial-gradient(circle, rgba(255,215,0,0.2) 0%, transparent 70%);
        border-radius: 50%;
        animation: pulse 6s infinite;
    }

    @keyframes pulse {
        0%, 100% { transform: scale(1); opacity: 0.3; }
        50% { transform: scale(1.2); opacity: 0.1; }
    }

    .library-header h1 {
        color: var(--white);
        font-weight: 800;
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
        position: relative;
        z-index: 1;
    }

    .library-header h1 i { color: var(--gold); margin-right: 1rem; }
    
    .library-header p {
        color: var(--gray-200);
        font-size: 1.1rem;
        position: relative;
        z-index: 1;
    }

    /* Dashboard Button */
    .dashboard-btn {
        background: var(--gold);
        color: var(--navy);
        padding: 12px 30px;
        border-radius: 50px;
        text-decoration: none;
        font-weight: 700;
        display: inline-flex;
        align-items: center;
        gap: 10px;
        transition: all 0.3s;
        border: 2px solid var(--navy);
        margin: 1rem 0;
    }

    .dashboard-btn:hover {
        background: var(--navy);
        color: var(--gold);
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }

    /* Search & Filter */
    .search-section {
        background: var(--white);
        border-radius: 20px;
        padding: 1.5rem;
        margin-bottom: 2rem;
        box-shadow: var(--shadow-lg);
        border: 2px solid var(--navy);
    }

    .search-container {
        display: flex;
        gap: 10px;
        margin-bottom: 1rem;
    }

    .search-input {
        flex: 1;
        padding: 1rem 1.5rem;
        border: 2px solid var(--gray-200);
        border-radius: 50px;
        font-size: 1rem;
        transition: all 0.3s;
        min-height: 50px;
    }

    .search-input:focus {
        outline: none;
        border-color: var(--gold);
        box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.2);
    }

    .filter-btn {
        background: var(--navy);
        color: var(--gold);
        border: 2px solid var(--gold);
        border-radius: 50px;
        padding: 0 2rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 10px;
        font-weight: 600;
        transition: all 0.3s;
        min-height: 50px;
    }

    .filter-btn:hover {
        background: var(--gold);
        color: var(--navy);
    }

    .active-filters {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin-top: 1rem;
    }

    .filter-tag {
        background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
        color: var(--gold);
        padding: 0.5rem 1rem;
        border-radius: 50px;
        font-size: 0.85rem;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        gap: 5px;
        border: 1px solid var(--gold);
    }

    .filter-tag i { cursor: pointer; }
    .filter-tag i:hover { color: var(--gold-light); }

    /* Notes Grid */
    .notes-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    /* Note Card */
    .note-card {
        background: var(--white);
        border-radius: 20px;
        padding: 1.5rem;
        box-shadow: var(--shadow-lg);
        border: 2px solid var(--navy);
        transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease;
        position: relative;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .note-card:hover {
        transform: translateY(-5px);
        border-color: var(--gold);
        box-shadow: var(--shadow-xl);
    }

    /* Loading state for cards */
    .note-card.loading {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
    }

    @keyframes loading {
        0% { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }

    .note-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .meta-badge {
        background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
        color: var(--gold);
        padding: 0.3rem 0.8rem;
        border-radius: 50px;
        font-size: 0.75rem;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        border: 1px solid var(--gold);
    }

    .note-title {
        color: var(--navy);
        font-size: 1.3rem;
        font-weight: 700;
        margin-bottom: 0.75rem;
        line-height: 1.3;
    }

    .note-description {
        color: var(--gray-600);
        margin-bottom: 1rem;
        line-height: 1.5;
        font-size: 0.9rem;
        flex: 1;
    }

    /* Action Buttons */
    .action-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 1rem;
    }

    .action-btn {
        padding: 0.7rem 1rem;
        border-radius: 50px;
        font-weight: 600;
        font-size: 0.85rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        cursor: pointer;
        transition: all 0.3s;
        border: 2px solid transparent;
        flex: 1;
        min-width: 70px;
    }

    .btn-preview { background: var(--navy); color: var(--gold); border-color: var(--gold); }
    .btn-preview:hover { background: var(--gold); color: var(--navy); }
    
    .btn-download { background: var(--gold); color: var(--navy); border-color: var(--navy); }
    .btn-download:hover { background: var(--navy); color: var(--gold); }
    
    .btn-like { background: var(--navy); color: var(--gold); border-color: var(--gold); }
    .btn-like:hover { background: #dc2626; color: white; border-color: #dc2626; }
    
    .btn-comment { background: var(--navy); color: var(--gold); border-color: var(--gold); }
    .btn-comment:hover { background: var(--gold); color: var(--navy); }
    
    .count-badge {
        background: var(--gold);
        color: var(--navy);
        padding: 0.15rem 0.5rem;
        border-radius: 50px;
        font-weight: 700;
        font-size: 0.7rem;
        margin-left: 4px;
    }

    /* Pagination */
    .pagination-container {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        margin: 2rem 0;
        flex-wrap: wrap;
    }

    .pagination-btn {
        background: var(--white);
        color: var(--navy);
        border: 2px solid var(--navy);
        padding: 0.6rem 1rem;
        border-radius: 10px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s;
        min-width: 45px;
        text-align: center;
        min-height: 44px;
    }

    .pagination-btn:hover,
    .pagination-btn.active {
        background: var(--navy);
        color: var(--gold);
        border-color: var(--gold);
    }

    .pagination-btn.disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .pagination-info {
        color: var(--gray-600);
        font-size: 0.85rem;
        margin: 0 0.5rem;
    }

    /* Empty State */
    .empty-state {
        text-align: center;
        padding: 3rem 1.5rem;
        background: var(--white);
        border-radius: 20px;
        border: 2px dashed var(--navy);
    }

    .empty-state i {
        font-size: 3rem;
        color: var(--gold);
        margin-bottom: 1rem;
    }

    .empty-state h3 {
        color: var(--navy);
        font-weight: 700;
        margin-bottom: 0.5rem;
    }

    .empty-state p { color: var(--gray-600); }

    /* Modal Styles */
    .modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.8);
        z-index: 9999;
        backdrop-filter: blur(5px);
    }

    .modal.show { display: block; }

    .modal-dialog {
        position: relative;
        width: 95%;
        max-width: 1200px;
        height: 90%;
        margin: 2% auto;
    }

    .modal-content {
        background: var(--white);
        border-radius: 20px;
        height: 100%;
        display: flex;
        flex-direction: column;
        border: 3px solid var(--navy);
    }

    .modal-header {
        background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
        color: var(--gold);
        padding: 1rem 1.5rem;
        border-radius: 17px 17px 0 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 3px solid var(--gold);
    }

    .close-btn {
        background: none;
        border: none;
        color: var(--gold);
        font-size: 2rem;
        cursor: pointer;
        line-height: 1;
        padding: 0 10px;
    }

    .modal-body {
        flex: 1;
        overflow-y: auto;
        padding: 1rem;
        background: var(--gray-50);
        -webkit-overflow-scrolling: touch;
    }

    .modal-footer {
        background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
        padding: 1rem;
        border-radius: 0 0 17px 17px;
        display: flex;
        justify-content: flex-end;
        gap: 1rem;
        border-top: 3px solid var(--gold);
    }

    /* PDF Viewer */
    .pdf-nav {
        position: sticky;
        top: 0;
        background: var(--white);
        padding: 0.8rem;
        border-bottom: 3px solid var(--gold);
        z-index: 10;
        display: flex;
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .pdf-container { text-align: center; }

    .pdf-canvas {
        max-width: 100%;
        height: auto;
        border: 2px solid var(--gray-200);
        border-radius: 10px;
        box-shadow: var(--shadow);
    }

    /* Tutorial Popup */
    .tutorial-popup {
        position: fixed;
        bottom: 20px;
        right: 20px;
        background: var(--navy);
        color: var(--gold);
        padding: 12px 20px;
        border-radius: 50px;
        cursor: pointer;
        z-index: 1000;
        box-shadow: var(--shadow-lg);
        border: 2px solid var(--gold);
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 10px;
        transition: all 0.3s;
    }

    .tutorial-popup:hover {
        transform: scale(1.05);
        background: var(--gold);
        color: var(--navy);
    }

    /* SweetAlert Customization */
    .tutorial-swal {
        border-radius: 20px !important;
        border: 3px solid var(--navy) !important;
    }

    .tutorial-swal .swal2-title {
        color: var(--navy) !important;
        font-size: 1.5rem !important;
    }

    .tutorial-swal .swal2-confirm {
        background-color: var(--navy) !important;
        border-radius: 50px !important;
        padding: 10px 30px !important;
    }

    /* Spinner */
    .spinner {
        width: 40px;
        height: 40px;
        border: 4px solid var(--gray-200);
        border-top: 4px solid var(--gold);
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin: 2rem auto;
    }

    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }

    /* Comment Styles */
    .comment-item {
        background: #f8f9fa;
        border-radius: 12px;
        padding: 12px;
        margin-bottom: 12px;
        border-left: 3px solid var(--gold);
    }

    .comment-avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: var(--navy);
        color: var(--gold);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 14px;
    }

    /* Keyboard Shortcut Styling */
    kbd {
        display: inline-block;
        padding: 3px 6px;
        font-size: 11px;
        line-height: 1;
        color: var(--navy);
        background-color: var(--gold);
        border-radius: 4px;
        box-shadow: inset 0 -1px 0 rgba(0,0,0,0.1);
        font-family: monospace;
        font-weight: bold;
    }

    /* AOS Animation */
    [data-aos] {
        opacity: 0;
        transition: opacity 0.6s ease;
    }

    [data-aos].aos-animate {
        opacity: 1;
    }

    /* ============================================ */
    /* RESPONSIVE BREAKPOINTS (Organized) */
    /* ============================================ */

    /* Tablet (769px - 1024px) */
    @media (min-width: 769px) and (max-width: 1024px) {
        .notes-grid {
            grid-template-columns: repeat(2, 1fr);
        }
        
        .btn-label {
            display: inline;
        }
    }

    /* Mobile (up to 768px) */
    @media (max-width: 768px) {
        .main-container {
            padding: 0 12px;
        }
        
        .library-header {
            padding: 1.5rem;
        }
        
        .library-header h1 {
            font-size: 1.5rem;
        }
        
        .library-header p {
            font-size: 0.9rem;
        }
        
        .notes-grid {
            grid-template-columns: 1fr;
            gap: 1rem;
        }
        
        .search-container {
            flex-direction: column;
        }
        
        .filter-btn {
            padding: 0.8rem;
            justify-content: center;
        }
        
        .action-buttons {
            flex-direction: row;
            flex-wrap: wrap;
        }
        
        .action-btn {
            flex: 1;
            min-width: 60px;
            padding: 0.5rem 0.6rem;
            font-size: 0.7rem;
        }
        
        /* Hide text labels on mobile, show only icons */
        .btn-label {
            display: none;
        }
        
        .action-btn {
            gap: 0;
        }
        
        .action-btn i {
            font-size: 1.1rem;
        }
        
        .note-title {
            font-size: 1.1rem;
        }
        
        .note-description {
            font-size: 0.8rem;
        }
        
        .meta-badge {
            font-size: 0.65rem;
            padding: 0.2rem 0.6rem;
        }
        
        .pagination-container {
            gap: 5px;
        }
        
        .pagination-btn {
            padding: 0.4rem 0.7rem;
            min-width: 35px;
            font-size: 0.75rem;
        }
        
        .pagination-info {
            font-size: 0.7rem;
        }
        
        .modal-dialog {
            width: 98%;
            height: 95%;
            margin: 1% auto;
        }
        
        .modal-header h5 {
            font-size: 1rem;
        }
        
        .tutorial-popup {
            bottom: 10px;
            right: 10px;
            padding: 8px 15px;
            font-size: 0.8rem;
        }
    }

    /* Desktop (1025px and above) */
    @media (min-width: 1025px) {
        .btn-label {
            display: inline;
        }
    }

    /* Touch Device Optimizations (no hover, touch only) */
    @media (hover: none) and (pointer: coarse) {
        .action-btn:active {
            transform: scale(0.96);
            opacity: 0.8;
        }
        
        .pagination-btn:active {
            transform: scale(0.96);
        }
    }

    /* Print Styles */
    @media print {
        .animated-bg,
        .library-header::before,
        .dashboard-btn,
        .search-section,
        .pagination-container,
        .tutorial-popup,
        .modal,
        .action-buttons,
        .navbar,
        footer {
            display: none !important;
        }
        
        .note-card {
            break-inside: avoid;
            page-break-inside: avoid;
            border: 1px solid #ccc !important;
            box-shadow: none !important;
        }
        
        .notes-grid {
            display: block;
        }
        
        .note-card {
            margin-bottom: 20px;
        }
        
        body {
            background: white !important;
        }
    }
