/* Better Notes CSS Stylesheet */
        :root {
            --bg-primary: #ffffff;
            --bg-secondary: #f8f8f8;
            --bg-tertiary: #e8e8e8;
            --bg-hover: #d8d8d8;
            --text-primary: #333;
            --text-secondary: #666;
            --text-tertiary: #999;
            --border-color: #e0e0e0;
            --border-color-dark: #d0d0d0;
            --accent-color: #0066cc;
            --accent-hover: #0052a3;
            --card-bg: #f8f8f8;
            --modal-bg: rgba(0, 0, 0, 0.5);
        }

        body.dark-theme {
            --bg-primary: #1a1a1a;
            --bg-secondary: #2a2a2a;
            --bg-tertiary: #3a3a3a;
            --bg-hover: #4a4a4a;
            --text-primary: #e0e0e0;
            --text-secondary: #b0b0b0;
            --text-tertiary: #808080;
            --border-color: #3a3a3a;
            --border-color-dark: #4a4a4a;
            --accent-color: #4d9fff;
            --accent-hover: #3d8fef;
            --card-bg: #2a2a2a;
            --modal-bg: rgba(0, 0, 0, 0.7);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: var(--bg-primary);
            color: var(--text-primary);
            padding: 0;
            margin: 0;
            transition: background-color 0.3s, color 0.3s;
        }

        .trimester-tabs {
            display: flex;
            gap: 5px;
            justify-content: center;
            padding: 15px;
            background: var(--bg-primary);
        }

        .tab {
            padding: 8px 16px;
            background: var(--bg-tertiary);
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            color: var(--text-secondary);
            transition: all 0.2s;
        }

        .tab:hover {
            background: var(--bg-hover);
        }

        .tab.active {
            background: var(--accent-color);
            color: white;
        }

        .container {
            background: var(--bg-primary);
        }

        .header {
            text-align: center;
            padding: 30px 20px;
            background: var(--bg-primary);
            border-bottom: 1px solid var(--border-color);
        }

        .header h1 {
            font-size: 24px;
            color: var(--text-primary);
            margin-bottom: 10px;
        }

        .average {
            font-size: 48px;
            font-weight: bold;
            color: var(--accent-color);
            margin: 10px 0;
        }

        .subject-list {
            padding: 20px;
        }

        .subject-item {
            background: var(--bg-secondary);
            margin-bottom: 0;
            border-radius: 0;
            overflow: hidden;
            border-bottom: 1px solid var(--border-color-dark);
        }

        .subject-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 20px;
            cursor: pointer;
            background: var(--bg-tertiary);
        }

        .subject-header:hover {
            background: var(--bg-hover);
        }

        .subject-name {
            font-weight: 600;
            color: var(--text-primary);
            font-size: 16px;
        }

        .eval-badge {
            display: inline-block;
            background: linear-gradient(135deg, #ff6b6b, #ff8e53);
            color: white;
            font-size: 10px;
            font-weight: 600;
            padding: 3px 8px;
            border-radius: 10px;
            margin-left: 8px;
            vertical-align: middle;
            box-shadow: 0 2px 4px rgba(255, 107, 107, 0.3);
            animation: pulse-eval 2s infinite;
        }

        @keyframes pulse-eval {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.9; transform: scale(1.02); }
        }

        body.dark-theme .eval-badge {
            background: linear-gradient(135deg, #ff5252, #ff7043);
            box-shadow: 0 2px 4px rgba(255, 82, 82, 0.4);
        }

        .subject-average {
            font-weight: bold;
            color: var(--accent-color);
            font-size: 18px;
        }

        .grades-container {
            padding: 12px 15px 45px 15px;
            display: block;
            background: var(--bg-primary);
            position: relative;
        }

        .grades-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
            gap: 6px;
            margin-bottom: 10px;
        }

        .grade-item {
            padding: 6px 8px;
            background: var(--bg-primary);
            border: 1px solid var(--border-color-dark);
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 13px;
            text-align: center;
        }

        .grade-item:hover {
            border-color: var(--accent-color);
            background: var(--bg-tertiary);
        }

        .grade-item.new {
            border: 3px solid var(--accent-color);
            font-weight: bold;
            box-shadow: 0 0 8px rgba(0, 102, 204, 0.3);
        }

        .grade-value {
            color: var(--accent-color);
            font-weight: 600;
            display: block;
            font-size: 12px;
            white-space: nowrap;
        }

        .grade-value sup {
            color: var(--text-secondary);
            font-size: 9px;
            font-weight: normal;
        }

        .btn {
            padding: 10px 20px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            transition: all 0.2s;
        }

        .btn-add-grade {
            background: #f5f5f5;
            color: #666;
            width: 32px;
            height: 32px;
            padding: 0;
            font-size: 20px;
            font-weight: 300;
            border: 1px solid #ddd;
            display: flex;
            align-items: center;
            justify-content: center;
            position: absolute;
            bottom: 10px;
            right: 10px;
        }

        .btn-add-grade:hover {
            background: #e8e8e8;
            border-color: #bbb;
        }

        .btn-delete-subject {
            background: #ffebee;
            color: #c62828;
            width: 32px;
            height: 32px;
            padding: 0;
            font-size: 16px;
            position: absolute;
            bottom: 10px;
            right: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .btn-delete-subject:hover {
            background: #ffcdd2;
        }

        .btn-edit-subject {
            background: #e3f2fd;
            color: #1976d2;
            width: 32px;
            height: 32px;
            padding: 0;
            font-size: 16px;
            position: absolute;
            bottom: 10px;
            right: 90px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .btn-edit-subject:hover {
            background: #bbdefb;
        }

        .btn-add-subject {
            width: 60px;
            height: 60px;
            padding: 0;
            background: #f5f5f5;
            color: #666;
            border: 1px solid #ddd;
            border-radius: 8px;
            cursor: pointer;
            font-size: 28px;
            font-weight: 300;
            margin: 10px auto;
            display: block;
            transition: all 0.2s;
        }

        .btn-add-subject:hover {
            background: #e8e8e8;
            border-color: #bbb;
        }

        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: var(--modal-bg);
            z-index: 1000;
            scrollbar-width: none;
            justify-content: center;
            align-items: center;
        }

        .modal.active {
            display: flex;
        }

        .modal-content {
            background: var(--bg-primary);
            padding: 30px;
            border-radius: 12px;
            width: 90%;
            max-width: 400px;
            scrollbar-width: none;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        }

        .modal-header {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 20px;
            color: var(--text-primary);
            position: relative;
        }

        .modal-close {
            position: absolute;
            top: 0;
            right: 0;
            background: none;
            border: none;
            font-size: 24px;
            color: var(--text-tertiary);
            cursor: pointer;
            padding: 0;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
        }

        .modal-close:hover {
            color: var(--text-primary);
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: var(--text-secondary);
            font-size: 14px;
            font-weight: 500;
        }

        .form-group input {
            width: 100%;
            padding: 12px;
            border: 2px solid var(--border-color);
            border-radius: 6px;
            font-size: 16px;
            transition: border-color 0.2s;
            background: var(--bg-secondary);
            color: var(--text-primary);
        }

        .form-group input:focus {
            outline: none;
            border-color: var(--accent-color);
        }

        .modal-buttons {
            display: flex;
            gap: 10px;
            margin-top: 25px;
            flex-wrap: wrap;
        }

        .modal-buttons.three-buttons {
            flex-direction: column;
        }

        .modal-buttons.three-buttons .btn-row {
            display: flex;
            gap: 10px;
            width: 100%;
        }

        .btn-modal {
            flex: 1;
            padding: 12px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 16px;
            font-weight: 600;
            transition: all 0.2s;
        }

        .btn-delete-full {
            width: 100%;
            background: #c62828;
            color: white;
            border: none;
            padding: 12px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 16px;
            font-weight: 600;
            transition: all 0.2s;
            margin-bottom: 5px;
        }

        .btn-delete-full:hover {
            background: #b71c1c;
        }

        .btn-cancel {
            background: var(--bg-tertiary);
            color: var(--text-secondary);
        }

        .btn-cancel:hover {
            background: var(--bg-hover);
        }

        .btn-save {
            background: var(--accent-color);
            color: white;
        }

        .btn-save:hover {
            background: var(--accent-hover);
        }

        .btn-delete {
            background: #c62828;
            color: white;
        }

        .btn-delete:hover {
            background: #b71c1c;
        }

        .version {
            text-align: center;
            color: var(--text-tertiary);
            font-size: 12px;
            cursor: pointer;
            user-select: none;
        }

        .version:hover {
            color: var(--accent-color);
        }

        .privacy-link {
            display: inline-block;
            text-align: center;
            padding: 15px 20px;
            color: var(--accent-color);
            font-size: 12px;
            text-decoration: none;
            cursor: pointer;
            user-select: none;
            transition: all 0.2s;
        }

        .privacy-link:hover {
            text-decoration: underline;
            opacity: 0.8;
        }

        .font-option {
            padding: 12px 16px;
            background: var(--bg-secondary);
            border: 2px solid var(--border-color);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 14px;
            color: var(--text-primary);
        }

        .font-option:hover {
            border-color: var(--accent-color);
            background: var(--bg-tertiary);
        }

        .font-option.selected {
            border-color: var(--accent-color);
            background: var(--accent-color);
            color: white;
        }

        .color-option {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            border: 3px solid transparent;
            cursor: pointer;
            transition: all 0.2s;
            padding: 0;
        }

        .color-option:hover {
            transform: scale(1.1);
            border-color: var(--accent-color);
        }

        .color-option.selected {
            border-color: var(--accent-color);
            box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
        }

        .color-picker-label {
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-tertiary);
            border: 3px solid var(--border-color-dark);
            color: var(--text-secondary);
            position: relative;
            overflow: hidden;
        }

        .color-picker-label:hover {
            transform: scale(1.1);
            border-color: var(--accent-color);
        }

        .color-picker-input {
            position: absolute;
            width: 100%;
            height: 100%;
            opacity: 0;
            cursor: pointer;
        }

        .edit-mode-toggle {
            margin: 20px;
            width: calc(100% - 40px);
            padding: 15px;
            background: #0066cc;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: block;
        }

        .edit-mode-toggle:hover {
            background: #0052a3;
        }

        .edit-mode-toggle.active {
            background: #ff9800;
        }

        .edit-mode-toggle.active:hover {
            background: #f57c00;
        }

        .btn-add-subject-edit {
            margin: 10px 20px;
            width: calc(100% - 40px);
            padding: 15px;
            background: #4caf50;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: none;
        }

        .btn-add-subject-edit:hover {
            background: #45a049;
        }

        .btn-add-subject-edit.visible {
            display: block;
        }

        .btn-account {
            margin: 10px 20px 20px 20px;
            width: calc(100% - 40px);
            padding: 15px;
            background: #9c27b0;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: block;
        }

        .btn-account:hover {
            background: #7b1fa2;
        }

        /* Hide mobile buttons on desktop */
        @media (min-width: 1024px) {
            .theme-toggle,
            .edit-mode-toggle,
            .btn-add-subject-edit,
            .btn-delete-all,
            .btn-account {
                display: none !important;
            }
        }

        .sync-status {
            position: fixed;
            top: 10px;
            right: 10px;
            padding: 8px 12px;
            background: #ff9800;
            color: white;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 600;
            display: none;
            z-index: 3000;
        }

        .sync-status.synced {
            background: #4caf50;
        }

        .sync-status.offline {
            background: #f44336;
        }

        .pwa-install-prompt {
            position: fixed;
            top: 10px;
            left: 10px;
            padding: 12px 16px;
            background: #2196F3;
            color: white;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 500;
            display: none;
            z-index: 3000;
            max-width: 280px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
            transition: all 0.3s;
        }

        .pwa-install-prompt.visible {
            display: block;
            animation: slideInLeft 0.5s ease-out;
        }

        .pwa-install-prompt .close-btn {
            position: absolute;
            top: 4px;
            right: 6px;
            background: none;
            border: none;
            color: white;
            font-size: 18px;
            cursor: pointer;
            padding: 0;
            width: 20px;
            height: 20px;
            line-height: 1;
            opacity: 0.8;
        }

        .pwa-install-prompt .close-btn:hover {
            opacity: 1;
        }

        .pwa-install-prompt .install-btn {
            margin-top: 10px;
            width: 100%;
            padding: 8px 16px;
            background: white;
            color: #2196F3;
            border: none;
            border-radius: 6px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .pwa-install-prompt .install-btn:hover {
            background: #f0f0f0;
            transform: scale(1.02);
        }

        @keyframes slideInLeft {
            from {
                opacity: 0;
                transform: translateX(-100%);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        .theme-toggle {
            margin: 10px 20px;
            width: calc(100% - 40px);
            padding: 15px;
            background: var(--bg-tertiary);
            color: var(--text-primary);
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: block;
        }

        .theme-toggle:hover {
            background: var(--bg-hover);
        }

        /* Toggle Switch */
        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 50px;
            height: 26px;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: var(--bg-tertiary);
            transition: 0.3s;
            border-radius: 26px;
        }

        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 20px;
            width: 20px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: 0.3s;
            border-radius: 50%;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }

        .toggle-switch input:checked + .toggle-slider {
            background-color: var(--accent-color);
        }

        .toggle-switch input:checked + .toggle-slider:before {
            transform: translateX(24px);
        }

        .toggle-switch input:disabled + .toggle-slider {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .account-button {
            position: fixed;
            top: 10px;
            left: 10px;
            padding: 8px 12px;
            background: #0066cc;
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            z-index: 3000;
        }

        .account-button:hover {
            background: #0052a3;
        }

        .transfer-popup {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            background: white;
            padding: 20px;
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
            z-index: 2500;
            display: none;
            max-width: 350px;
            width: 90%;
        }

        .transfer-popup.visible {
            display: block;
        }

        .transfer-popup h3 {
            margin-bottom: 10px;
            font-size: 18px;
            color: #333;
        }

        .transfer-popup p {
            margin-bottom: 15px;
            color: #666;
            font-size: 14px;
        }

        .transfer-popup button {
            width: 100%;
            padding: 12px;
            margin-bottom: 8px;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
        }

        .transfer-popup .btn-primary {
            background: #0066cc;
            color: white;
        }

        .transfer-popup .btn-secondary {
            background: #f5f5f5;
            color: #666;
        }

        .onboarding-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: white;
            z-index: 5000;
            display: none;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            padding: 40px 20px;
        }

        .onboarding-overlay.active {
            display: flex;
        }

        .onboarding-overlay.interactive {
            background: rgba(0, 0, 0, 0.7);
            z-index: 900;
        }

        .onboarding-overlay.interactive .onboarding-content {
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: white;
            padding: 20px;
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
            max-width: 400px;
        }

        .onboarding-highlight {
            position: relative;
            z-index: 1000 !important;
            box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.7) !important;
            animation: pulse 2s infinite !important;
        }

        .onboarding-highlight-green {
            position: relative;
            z-index: 1000 !important;
            box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.7) !important;
            animation: pulse 2s infinite !important;
        }

        .onboarding-content {
            max-width: 500px;
            width: 100%;
            text-align: center;
            position: relative;
        }

        .onboarding-screen {
            display: none;
            animation: fadeSlideIn 0.5s ease-out;
        }

        .onboarding-screen.active {
            display: block;
        }

        .onboarding-screen.exit {
            animation: fadeSlideOut 0.3s ease-in forwards;
        }

        @keyframes fadeSlideIn {
            from {
                opacity: 0;
                transform: translateX(30px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        @keyframes fadeSlideOut {
            from {
                opacity: 1;
                transform: translateX(0);
            }
            to {
                opacity: 0;
                transform: translateX(-30px);
            }
        }

        .onboarding-content h2 {
            font-size: 28px;
            color: #333;
            margin-bottom: 20px;
        }

        .onboarding-content p {
            font-size: 18px;
            color: #666;
            margin-bottom: 30px;
            line-height: 1.6;
        }

        .onboarding-button {
            width: 100%;
            padding: 15px;
            margin-bottom: 15px;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .onboarding-button.primary {
            background: #0066cc;
            color: white;
        }

        .onboarding-button.primary:hover {
            background: #0052a3;
        }

        .onboarding-button.secondary {
            background: #f5f5f5;
            color: #666;
        }

        .onboarding-button.secondary:hover {
            background: #e0e0e0;
        }

        .onboarding-form {
            margin: 30px 0;
        }

        .onboarding-form .form-group {
            margin-bottom: 20px;
            text-align: left;
        }

        .onboarding-form label {
            display: block;
            margin-bottom: 8px;
            color: #333;
            font-size: 14px;
            font-weight: 500;
        }

        .onboarding-form input {
            width: 100%;
            padding: 12px;
            border: 2px solid #e0e0e0;
            border-radius: 6px;
            font-size: 16px;
        }

        .onboarding-form input:focus {
            outline: none;
            border-color: #0066cc;
        }

        .onboarding-option {
            width: 100%;
            padding: 20px;
            margin-bottom: 15px;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            background: white;
            cursor: pointer;
            transition: all 0.2s;
            text-align: left;
        }

        .onboarding-option:hover {
            border-color: #0066cc;
            background: #f0f8ff;
        }

        .onboarding-option h3 {
            font-size: 16px;
            color: #333;
            margin-bottom: 5px;
        }

        .onboarding-option p {
            font-size: 14px;
            color: #666;
            margin: 0;
        }

        .grade-level-selector {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin: 30px 0;
        }

        .grade-level-option {
            padding: 20px;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            background: white;
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
            font-size: 18px;
            font-weight: 600;
            color: #333;
        }

        .grade-level-option:hover {
            border-color: #0066cc;
            background: #f0f8ff;
        }

        .template-options {
            text-align: left;
            margin: 30px 0;
        }

        .template-option-group {
            margin-bottom: 25px;
        }

        .template-option-group label {
            display: block;
            font-size: 16px;
            font-weight: 500;
            color: #333;
            margin-bottom: 10px;
        }

        .radio-option, .checkbox-option {
            display: flex;
            align-items: center;
            padding: 12px;
            margin-bottom: 8px;
            border: 2px solid #e0e0e0;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .data-collecting-notice {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            margin: 20px 0;
            padding: 15px;
            background: #f5f5f5;
            border-radius: 8px;
            font-size: 13px;
            color: #666;
            text-align: left;
            position: relative;
            overflow: visible;
        }

        .data-collecting-notice input[type="checkbox"] {
            width: 20px;
            height: 20px;
            cursor: pointer;
            flex-shrink: 0;
        }

        .data-collect-help {
            position: absolute;
            top: 0px;
            right: 0px;
            width: 18px;
            height: 18px;
            background: #ddd;
            border-radius: 50%;
            font-size: 11px;
            font-weight: 700;
            color: #666;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s;
        }

        .data-collect-help:hover {
            background: #ccc;
            color: #333;
        }

        .data-collect-popup {
            position: absolute;
            top: 30px;
            right: 0;
            width: 280px;
            background: white;
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.2);
            padding: 15px;
            font-size: 12px;
            color: #333;
            z-index: 100;
            opacity: 0;
            visibility: hidden;
            transform: translateY(-10px);
            transition: all 0.2s ease;
        }

        .data-collect-popup.visible {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .data-collect-popup h4 {
            margin: 0 0 10px 0;
            font-size: 14px;
            color: #333;
        }

        .data-collect-popup ul {
            margin: 0;
            padding-left: 18px;
        }

        .data-collect-popup li {
            margin-bottom: 6px;
            line-height: 1.4;
        }

        .data-collect-popup .collected {
            color: #4CAF50;
        }

        .data-collect-popup .not-collected {
            color: #f44336;
        }

        .data-collect-popup .close-popup {
            position: absolute;
            top: 8px;
            right: 8px;
            background: none;
            border: none;
            font-size: 16px;
            cursor: pointer;
            color: #999;
            padding: 0;
            line-height: 1;
        }

        .data-collect-popup .close-popup:hover {
            color: #333;
        }

        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 44px;
            height: 24px;
            flex-shrink: 0;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #ccc;
            transition: 0.3s;
            border-radius: 24px;
        }

        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 18px;
            width: 18px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: 0.3s;
            border-radius: 50%;
        }

        .toggle-switch input:checked + .toggle-slider {
            background-color: #4CAF50;
        }

        .toggle-switch input:checked + .toggle-slider:before {
            transform: translateX(20px);
        }

        .data-collect-thanks {
            position: absolute;
            top: -30px;
            left: 0;
            right: 0;
            text-align: center;
            font-size: 13px;
            color: #4CAF50;
            font-weight: 600;
            opacity: 0;
            transform: translateY(35px);
            transition: all 0.3s ease;
            pointer-events: none;
        }

        .data-collect-thanks.visible {
            opacity: 1;
            transform: translateY(0);
        }

        .confetti {
            position: absolute;
            width: 10px;
            height: 10px;
            opacity: 0;
        }

        .confetti.animate {
            animation: confetti-fall 1.5s ease-out forwards;
        }

        @keyframes confetti-fall {
            0% {
                opacity: 1;
                transform: translateY(0) rotate(0deg) scale(1);
            }
            100% {
                opacity: 0;
                transform: translateY(100px) rotate(720deg) scale(0.5);
            }
        }

        .radio-option:hover, .checkbox-option:hover {
            border-color: #0066cc;
            background: #f0f8ff;
        }

        .radio-option input[type="radio"],
        .checkbox-option input[type="checkbox"] {
            width: 20px;
            height: 20px;
            margin-right: 10px;
            cursor: pointer;
        }

        .radio-option span, .checkbox-option span {
            font-size: 16px;
            color: #333;
        }

        .btn-delete-all {
            margin: 10px 20px;
            width: calc(100% - 40px);
            padding: 15px;
            background: #d32f2f;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: none;
        }

        .btn-delete-all:hover {
            background: #b71c1c;
        }

        .btn-delete-all.visible {
            display: block;
        }

        .delete-confirm-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 2000;
            justify-content: center;
            align-items: center;
        }

        .delete-confirm-modal.active {
            display: flex;
        }

        .delete-confirm-content {
            background: white;
            padding: 30px;
            border-radius: 12px;
            width: 90%;
            max-width: 400px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
            text-align: center;
        }

        .delete-confirm-content h2 {
            color: #d32f2f;
            margin-bottom: 20px;
            font-size: 24px;
        }

        .delete-confirm-content p {
            color: #666;
            margin-bottom: 20px;
            font-size: 16px;
            line-height: 1.5;
        }

        .delete-timer {
            font-size: 48px;
            font-weight: bold;
            color: #0066cc;
            margin: 20px 0;
        }

        .btn-confirm-delete {
            width: 100%;
            padding: 15px;
            margin-bottom: 10px;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            background: #d32f2f;
            color: white;
            transition: all 0.2s;
        }

        .btn-confirm-delete:disabled {
            background: #ccc;
            cursor: not-allowed;
            opacity: 0.6;
        }

        .btn-confirm-delete:not(:disabled):hover {
            background: #b71c1c;
        }

        .btn-cancel-delete {
            width: 100%;
            padding: 15px;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            background: #f5f5f5;
            color: #666;
        }

        .btn-cancel-delete:hover {
            background: #e0e0e0;
        }

        /* Floating Control Panel */
        .floating-controls {
            position: fixed;
            bottom: 20px;
            left: 20px;
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 12px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            z-index: 2000;
            opacity: 0.7;
            transition: all 0.3s;
        }

        .floating-controls:hover {
            opacity: 1;
        }

        .floating-controls button {
            min-width: 44px;
            height: 44px;
            padding: 0 12px;
            background: var(--bg-tertiary);
            color: var(--text-primary);
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 8px;
            transition: all 0.2s;
            margin: 0;
            white-space: nowrap;
        }

        .floating-controls button .icon {
            font-size: 20px;
            min-width: 20px;
            text-align: center;
        }

        .floating-controls button .label {
            font-size: 13px;
            font-weight: 500;
        }

        .floating-controls button:hover {
            background: var(--bg-hover);
            transform: scale(1.05);
        }

        .floating-controls button.active {
            background: var(--accent-color);
            color: white;
        }

        .floating-controls button.danger {
            background: #ffebee;
            color: #c62828;
        }

        .floating-controls button.danger:hover {
            background: #ffcdd2;
        }

        .floating-controls button.add {
            background: #e8f5e9;
            color: #2e7d32;
        }

        .floating-controls button.add:hover {
            background: #c8e6c9;
        }

        .floating-controls .divider {
            height: 1px;
            background: var(--border-color);
            margin: 4px 0;
        }

        @media (max-width: 1023px) {
            .floating-controls {
                display: none;
            }
        }

        @media (min-width: 1024px) {
            body {
                display: flex;
                flex-direction: column;
                min-height: 100vh;
            }

            .trimester-tabs {
                padding: 20px;
                gap: 10px;
            }

            .tab {
                padding: 12px 24px;
                font-size: 16px;
            }

            .container {
                display: grid;
                grid-template-columns: 350px 1fr;
                gap: 0;
                max-width: 1400px;
                margin: 0 auto;
                width: 100%;
                flex: 1;
            }

            .header {
                border-bottom: none;
                border-right: 1px solid var(--border-color);
                padding: 40px 30px;
                position: sticky;
                top: 0;
                height: fit-content;
                max-height: 100vh;
                overflow-y: auto;
            }

            .header h1 {
                font-size: 28px;
            }

            .average {
                font-size: 64px;
            }

            .subject-list {
                padding: 30px;
                overflow-y: auto;
                display: grid;
                grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
                gap: 20px;
                align-content: start;
            }

            .subject-item {
                border: 1px solid var(--border-color);
                border-radius: 12px;
                height: fit-content;
            }

            .subject-header {
                padding: 20px 25px;
                border-radius: 12px 12px 0 0;
            }

            .subject-name {
                font-size: 18px;
            }

            .subject-average {
                font-size: 22px;
            }

            .grades-container {
                padding: 20px 25px 60px 25px;
            }

            .grades-grid {
                grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
                gap: 10px;
            }

            .grade-item {
                padding: 10px 12px;
                font-size: 15px;
            }

            .grade-value {
                font-size: 14px;
            }

            .btn-add-grade {
                width: 40px;
                height: 40px;
                font-size: 24px;
                bottom: 12px;
                right: 12px;
            }

            .btn-delete-subject {
                width: 40px;
                height: 40px;
                font-size: 18px;
                bottom: 12px;
                right: 60px;
            }

            .btn-edit-subject {
                width: 40px;
                height: 40px;
                font-size: 18px;
                bottom: 12px;
                right: 108px;
            }

            .modal-content {
                max-width: 500px;
                padding: 40px;
            }

            .modal-header {
                font-size: 24px;
                margin-bottom: 25px;
            }

            .form-group input {
                padding: 14px;
                font-size: 17px;
            }

            .btn-modal {
                padding: 14px;
                font-size: 17px;
            }

            .floating-controls {
                bottom: 30px;
                left: 30px;
            }

            .version {
                text-align: center;
                font-size: 13px;
                grid-column: 1 / -1;
            }

            .onboarding-content {
                max-width: 600px;
                padding: 40px;
            }

            .onboarding-content h2 {
                font-size: 30px;
            }

            .onboarding-content p {
                font-size: 15px;
            }

            .onboarding-button {
                padding: 16px;
                font-size: 17px;
            }

            .grade-level-selector {
                grid-template-columns: repeat(4, 1fr);
                gap: 20px;
            }

            .grade-level-option {
                padding: 30px;
                font-size: 20px;
            }

            .delete-confirm-content {
                max-width: 500px;
                padding: 40px;
            }

            .delete-confirm-content h2 {
                font-size: 28px;
            }

            .delete-confirm-content p {
                font-size: 17px;
            }

            .delete-timer {
                font-size: 56px;
            }
        }
        
        @keyframes pulse {
            0%, 100% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.05);
            }
        }

        /* Loading spinner */
        .loading-spinner {
            width: 50px;
            height: 50px;
            border: 4px solid var(--bg-tertiary);
            border-top: 4px solid var(--accent-color);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* ED 2FA options */
        .ed-2fa-option {
            padding: 12px 16px;
            background: var(--bg-secondary);
            border: 2px solid var(--border-color);
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.2s;
            text-align: center;
            min-width: 120px;
        }

        .ed-2fa-option:hover {
            border-color: var(--accent-color);
            background: var(--bg-tertiary);
        }

        /* Toggle switch */
        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 50px;
            height: 26px;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: var(--bg-tertiary);
            transition: 0.3s;
            border-radius: 26px;
            border: 1px solid var(--border-color);
        }

        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 20px;
            width: 20px;
            left: 2px;
            bottom: 2px;
            background-color: white;
            transition: 0.3s;
            border-radius: 50%;
            box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        }

        .toggle-switch input:checked + .toggle-slider {
            background-color: #4caf50;
            border-color: #4caf50;
        }

        .toggle-switch input:checked + .toggle-slider:before {
            transform: translateX(24px);
        }

        .toggle-switch input:disabled + .toggle-slider {
            opacity: 0.5;
            cursor: not-allowed;
        }