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

        html, body {
            overflow-x: hidden;
            width: 100%;
            -webkit-text-size-adjust: 100%;
        }

        button {
            cursor: pointer;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
            touch-action: manipulation;
        }

        button:active {
            opacity: 0.8;
        }

        .emoji-btn, .theme-option, .badge-item, .week-task {
            cursor: pointer;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
            user-select: none;
            -webkit-user-select: none;
            touch-action: manipulation;
        }

        .emoji-btn:active, .theme-option:active {
            opacity: 0.7;
        }

        /* iOS Safe Area Support */
        @supports(padding: max(0px)) {
            body {
                padding-left: max(20px, env(safe-area-inset-left));
                padding-right: max(20px, env(safe-area-inset-right));
                padding-bottom: max(20px, env(safe-area-inset-bottom));
            }

            @media (max-width: 768px) {
                body {
                    padding-left: max(10px, env(safe-area-inset-left));
                    padding-right: max(10px, env(safe-area-inset-right));
                }
            }

            .floating-btn {
                bottom: calc(20px + env(safe-area-inset-bottom));
                right: calc(20px + env(safe-area-inset-right));
            }

            @media (max-width: 768px) {
                .floating-btn {
                    bottom: calc(20px + env(safe-area-inset-bottom));
                    right: calc(15px + env(safe-area-inset-right));
                }
            }
        }

        :root {
            /* Default theme - Classic Purple */
            --primary-color: #667eea;
            --primary-dark: #5568d3;
            --secondary-color: #764ba2;
            --gradient-start: #667eea;
            --gradient-end: #764ba2;
            --accent-color: #2ecc71;
            --background-gradient: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
        }

        /* Theme variations */
        body.theme-ocean-blue {
            --primary-color: #3498db;
            --primary-dark: #2980b9;
            --secondary-color: #2c3e50;
            --gradient-start: #3498db;
            --gradient-end: #2c3e50;
        }

        body.theme-sunset-pink {
            --primary-color: #ff6b9d;
            --primary-dark: #c44569;
            --secondary-color: #ff9a76;
            --gradient-start: #ff6b9d;
            --gradient-end: #ffa751;
        }

        body.theme-forest-green {
            --primary-color: #27ae60;
            --primary-dark: #229954;
            --secondary-color: #16a085;
            --gradient-start: #27ae60;
            --gradient-end: #16a085;
        }

        body.theme-midnight-dark {
            --primary-color: #34495e;
            --primary-dark: #2c3e50;
            --secondary-color: #1a1a2e;
            --gradient-start: #2c3e50;
            --gradient-end: #1a1a2e;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background: var(--background-gradient);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
            overflow-x: hidden;
        }

        @media (max-width: 768px) {
            body {
                padding: 5px;
                align-items: flex-start;
            }
        }

        .container {
            background: white;
            border-radius: 10px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 1400px;
            padding: 30px;
            overflow-x: hidden;
        }

        @media (max-width: 768px) {
            .container {
                padding: 10px;
                border-radius: 0;
                min-height: 100vh;
            }
        }

        .main-layout {
            display: flex;
            gap: 30px;
            align-items: flex-start;
            box-sizing: border-box;
            max-width: 100%;
        }

        .calendar-section {
            flex: 0 0 350px;
            position: sticky;
            top: 20px;
            max-width: 100%;
            box-sizing: border-box;
        }

        .todo-section {
            flex: 1;
            min-width: 0;
        }

        @media (max-width: 768px) {
            .main-layout {
                gap: 15px;
            }
        }

        h1 {
            color: #333;
            margin-bottom: 30px;
            text-align: center;
        }

        .notification-status {
            text-align: center;
            padding: 10px;
            margin-bottom: 20px;
            border-radius: 5px;
            font-size: 14px;
        }

        @media (max-width: 768px) {
            .notification-status {
                font-size: 12px;
                padding: 8px;
                margin-bottom: 15px;
            }

            .notification-status button {
                display: block;
                margin: 10px auto 0;
                width: 100%;
                max-width: 200px;
            }
        }

        .notification-status.enabled {
            background: #d4edda;
            color: #155724;
        }

        .notification-status.disabled {
            background: #fff3cd;
            color: #856404;
        }

        .notification-status button {
            margin-left: 10px;
            padding: 5px 15px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            background: var(--primary-color);
            color: white;
            font-size: 13px;
        }

        .notification-status button:hover {
            background: var(--primary-dark);
        }

        .input-container {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 20px;
        }

        .input-row {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        @media (max-width: 768px) {
            .input-row {
                flex-direction: column;
            }

            .input-row input,
            .input-row select,
            .input-row button {
                width: 100% !important;
                min-width: unset !important;
            }
        }

        #todoInput {
            flex: 1;
            padding: 12px 15px;
            border: 2px solid #e0e0e0;
            border-radius: 5px;
            font-size: 16px;
            transition: border-color 0.3s;
            -webkit-appearance: none;
            appearance: none;
            box-sizing: border-box;
            max-width: 100%;
        }

        #todoInput:focus {
            outline: none;
            border-color: var(--primary-color);
        }

        #deadlineInput, #assigneeInput {
            padding: 12px 15px;
            border: 2px solid #e0e0e0;
            border-radius: 5px;
            font-size: 16px;
            transition: border-color 0.3s;
            -webkit-appearance: none;
            appearance: none;
            box-sizing: border-box;
            max-width: 100%;
        }

        #deadlineInput:focus, #assigneeInput:focus {
            outline: none;
            border-color: var(--primary-color);
        }

        #assigneeInput {
            flex: 1;
        }

        #deadlineInput {
            min-width: 200px;
            max-width: 100%;
        }

        @media (max-width: 768px) {
            #deadlineInput {
                min-width: unset;
                width: 100%;
            }
        }

        #addBtn {
            padding: 12px 25px;
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: 5px;
            font-size: 16px;
            cursor: pointer;
            transition: background 0.3s;
        }

        #addBtn:hover {
            background: var(--primary-dark);
        }

        .filters {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            justify-content: center;
        }

        .filter-btn {
            padding: 8px 16px;
            border: 2px solid #e0e0e0;
            background: white;
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .filter-btn.active {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }

        .filter-btn:hover {
            border-color: var(--primary-color);
        }

        #todoList {
            list-style: none;
        }

        .todo-item {
            display: flex;
            align-items: flex-start;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 5px;
            margin-bottom: 10px;
            transition: all 0.3s;
            flex-wrap: wrap;
        }

        .todo-item:hover {
            transform: translateX(5px);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }

        .todo-item.completed {
            opacity: 0.6;
        }

        .todo-item.completed .todo-text {
            text-decoration: line-through;
        }

        .todo-item.overdue {
            border-left: 4px solid #ff4757;
        }

        .todo-checkbox {
            width: 20px;
            height: 20px;
            margin-right: 15px;
            margin-top: 2px;
            cursor: pointer;
            flex-shrink: 0;
        }

        .todo-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .todo-text {
            color: #333;
            font-size: 16px;
            font-weight: 500;
        }

        .todo-meta {
            display: flex;
            gap: 15px;
            font-size: 13px;
            color: #666;
        }

        .todo-meta-item {
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .todo-meta-label {
            font-weight: 600;
        }

        .todo-deadline {
            color: var(--primary-color);
        }

        .todo-deadline.overdue {
            color: #ff4757;
            font-weight: 600;
        }

        .todo-assignee {
            color: #2ecc71;
        }

        .edit-btn {
            padding: 6px 12px;
            background: #3498db;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            transition: background 0.3s;
            align-self: flex-start;
            margin-left: 10px;
            flex-shrink: 0;
        }

        .edit-btn:hover {
            background: #2980b9;
        }

        .delete-btn {
            padding: 6px 12px;
            background: #ff4757;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            transition: background 0.3s;
            align-self: flex-start;
            margin-left: 10px;
            flex-shrink: 0;
        }

        .delete-btn:hover {
            background: #ff3838;
        }

        .stats {
            margin-top: 20px;
            padding-top: 20px;
            border-top: 2px solid #e0e0e0;
            text-align: center;
            color: #666;
        }

        .empty-state {
            text-align: center;
            padding: 40px;
            color: #999;
        }

        .header-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
            flex-wrap: wrap;
            gap: 15px;
        }

        @media (max-width: 768px) {
            .header-container {
                margin-bottom: 20px;
            }

            .header-container h1 {
                font-size: 24px;
                flex: 1 1 100%;
                text-align: center;
            }

            .header-buttons {
                flex: 1 1 100%;
                justify-content: center;
            }
        }

        .header-container h1 {
            margin: 0;
        }

        .header-buttons {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            position: relative;
            z-index: 10;
        }

        #settingsBtn, #customizeBtn, #syncBtn, #firebaseSetupBtn, #googleSignInBtn {
            padding: 8px 16px;
            background: white;
            border: 2px solid var(--primary-color);
            color: var(--primary-color);
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.3s;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            -webkit-appearance: none;
            appearance: none;
            touch-action: manipulation;
            position: relative;
            z-index: 10;
        }

        #settingsBtn:hover, #customizeBtn:hover, #syncBtn:hover, #firebaseSetupBtn:hover, #googleSignInBtn:hover {
            background: var(--primary-color);
            color: white;
        }

        #googleSignInBtn {
            background: #4285f4;
            border-color: #4285f4;
            color: white;
            font-weight: 600;
        }

        #googleSignInBtn:hover {
            background: #357ae8;
            border-color: #357ae8;
        }

        #userProfile {
            display: inline-flex;
            align-items: center;
            padding: 4px 12px 4px 4px;
            background: #f0f0f0;
            border-radius: 20px;
            font-size: 14px;
        }

        #userProfile #userName {
            font-weight: 600;
            color: #333;
            max-width: 150px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        #signOutBtn {
            padding: 4px 12px;
            background: #ff4757;
            color: white;
            border: none;
            border-radius: 12px;
            cursor: pointer;
            font-size: 12px;
            transition: background 0.3s;
        }

        #signOutBtn:hover {
            background: #ff3838;
        }

        @media (max-width: 768px) {
            #settingsBtn, #customizeBtn, #syncBtn, #firebaseSetupBtn, #googleSignInBtn {
                font-size: 13px;
                padding: 6px 12px;
            }

            #userProfile #userName {
                max-width: 100px;
                font-size: 13px;
            }

            #userAvatar {
                width: 28px !important;
                height: 28px !important;
            }

            #syncStatus {
                font-size: 11px !important;
                margin-top: 8px !important;
            }
        }

        #priorityInput {
            padding: 12px 15px;
            border: 2px solid #e0e0e0;
            border-radius: 5px;
            font-size: 16px;
            transition: border-color 0.3s;
            cursor: pointer;
            min-width: 160px;
        }

        #priorityInput:focus {
            outline: none;
            border-color: var(--primary-color);
        }

        .todo-priority {
            display: inline-block;
            padding: 3px 10px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            color: white;
            letter-spacing: 0.5px;
        }

        .sort-controls {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            justify-content: center;
            align-items: center;
            font-size: 14px;
            color: #666;
        }

        .sort-btn {
            padding: 6px 12px;
            border: 2px solid #e0e0e0;
            background: white;
            border-radius: 5px;
            cursor: pointer;
            font-size: 13px;
            transition: all 0.3s;
        }

        .sort-btn.active {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }

        .sort-btn:hover {
            border-color: var(--primary-color);
        }

        .modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            display: flex;
            justify-content: center;
            align-items: flex-start;
            z-index: 10000;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            padding: 20px 0;
        }

        .modal-content {
            background: white;
            padding: 30px;
            border-radius: 10px;
            max-width: 500px;
            width: 90%;
            max-height: calc(100vh - 40px);
            overflow-y: auto;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
            margin: auto;
        }

        .modal-content h2 {
            margin-bottom: 20px;
            color: #333;
        }

        .color-settings {
            margin-bottom: 20px;
        }

        .color-setting-item {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 15px;
            padding: 10px;
            background: #f8f9fa;
            border-radius: 5px;
        }

        .color-setting-item label {
            flex: 1;
            font-weight: 600;
            color: #333;
        }

        .color-setting-item input[type="color"] {
            width: 60px;
            height: 40px;
            border: 2px solid #e0e0e0;
            border-radius: 5px;
            cursor: pointer;
        }

        .color-preview {
            padding: 8px 16px;
            border-radius: 12px;
            color: white;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            min-width: 80px;
            text-align: center;
        }

        .modal-actions {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
        }

        .modal-actions button {
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.3s;
        }

        .modal-actions #saveSettings {
            background: var(--primary-color);
            color: white;
        }

        .modal-actions #saveSettings:hover {
            background: var(--primary-dark);
        }

        .modal-actions #resetSettings {
            background: #f39c12;
            color: white;
        }

        .modal-actions #resetSettings:hover {
            background: #e67e22;
        }

        .modal-actions #closeSettings {
            background: #95a5a6;
            color: white;
        }

        .modal-actions #closeSettings:hover {
            background: #7f8c8d;
        }

        .calendar-container {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 20px;
        }

        .view-toggle {
            display: flex;
            gap: 5px;
            margin-bottom: 15px;
            background: white;
            padding: 5px;
            border-radius: 8px;
        }

        .view-toggle-btn {
            flex: 1;
            padding: 8px 16px;
            background: transparent;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            color: #666;
            transition: all 0.3s;
        }

        .view-toggle-btn.active {
            background: var(--primary-color);
            color: white;
        }

        .view-toggle-btn:hover:not(.active) {
            background: #f0f0f0;
        }

        .calendar-nav-secondary {
            text-align: center;
            margin-bottom: 15px;
        }

        .today-btn {
            padding: 6px 20px;
            background: white;
            border: 2px solid var(--primary-color);
            color: var(--primary-color);
            border-radius: 5px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 600;
            transition: all 0.3s;
        }

        .today-btn:hover {
            background: var(--primary-color);
            color: white;
        }

        /* Week View Styles */
        .week-view-container {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 10px;
        }

        .week-day-column {
            background: white;
            border-radius: 8px;
            padding: 10px;
            min-height: 300px;
        }

        .week-day-column.weekend {
            background: #f8f9fa;
        }

        .week-day-column.today-column {
            background: #e8f5e9;
            border: 2px solid #4caf50;
        }

        .week-day-header {
            text-align: center;
            font-weight: 700;
            font-size: 14px;
            color: #333;
            padding-bottom: 8px;
            border-bottom: 2px solid #e0e0e0;
            margin-bottom: 10px;
        }

        .week-day-date {
            font-size: 18px;
            display: block;
            color: var(--primary-color);
        }

        .week-task {
            background: white;
            border: 1px solid #e0e0e0;
            border-radius: 6px;
            padding: 8px;
            margin-bottom: 8px;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
        }

        .week-task:hover {
            transform: translateY(-2px);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .week-task.completed {
            opacity: 0.6;
        }

        .week-task-text {
            font-size: 13px;
            color: #333;
            margin-bottom: 4px;
            line-height: 1.3;
        }

        .week-task.completed .week-task-text {
            text-decoration: line-through;
        }

        .week-task-time {
            font-size: 11px;
            color: #666;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .week-task-priority {
            display: inline-block;
            padding: 2px 6px;
            border-radius: 8px;
            font-size: 9px;
            font-weight: 700;
            text-transform: uppercase;
            color: white;
            margin-right: 4px;
        }

        .week-no-tasks {
            text-align: center;
            color: #999;
            font-size: 12px;
            padding: 20px 10px;
        }

        @media (max-width: 768px) {
            .week-view-container {
                grid-template-columns: 1fr;
                gap: 15px;
            }

            .week-day-column {
                min-height: auto;
            }

            .week-task {
                padding: 10px;
            }

            .week-task-text {
                font-size: 14px;
            }
        }

        .calendar-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .calendar-header h3 {
            margin: 0;
            color: #333;
            cursor: pointer;
            transition: color 0.3s;
            touch-action: manipulation;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
            user-select: none;
            -webkit-user-select: none;
        }

        .calendar-header h3:hover {
            color: var(--primary-color);
        }

        .calendar-header h3:active {
            opacity: 0.7;
        }

        .calendar-nav {
            display: flex;
            gap: 10px;
        }

        .calendar-nav button {
            padding: 5px 15px;
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
            transition: background 0.3s;
            -webkit-appearance: none;
            appearance: none;
            touch-action: manipulation;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
            min-width: 40px;
            min-height: 40px;
        }

        .calendar-nav button:hover {
            background: var(--primary-dark);
        }

        .calendar-nav button:active {
            opacity: 0.7;
        }

        .calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 5px;
            width: 100%;
            max-width: 100%;
            overflow-x: hidden;
            box-sizing: border-box;
        }

        @media (max-width: 768px) {
            .calendar-grid {
                gap: 2px;
            }
        }

        .calendar-day-header {
            text-align: center;
            font-weight: 600;
            color: #666;
            padding: 10px;
            font-size: 12px;
            box-sizing: border-box;
        }

        @media (max-width: 768px) {
            .calendar-day-header {
                padding: 5px 2px;
                font-size: 10px;
            }
        }

        .calendar-day {
            aspect-ratio: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: white;
            border: 2px solid #e0e0e0;
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.3s;
            position: relative;
            padding: 5px;
            min-height: 50px;
            touch-action: manipulation;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
            box-sizing: border-box;
        }

        @media (max-width: 768px) {
            .calendar-day {
                padding: 2px;
                min-height: 40px;
                border-width: 1px;
                border-radius: 3px;
            }
        }

        .calendar-day:active {
            opacity: 0.7;
        }

        .calendar-day:hover {
            border-color: var(--primary-color);
            transform: scale(1.05);
        }

        .calendar-day.other-month {
            opacity: 0.3;
        }

        .calendar-day.today {
            border-color: #2ecc71;
            background: #d4edda;
        }

        .calendar-day.selected {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }

        .calendar-day.has-tasks {
            font-weight: 700;
        }

        .calendar-day-number {
            font-size: 14px;
        }

        .calendar-task-count {
            font-size: 10px;
            color: #667eea;
            margin-top: 2px;
        }

        .calendar-day.selected .calendar-task-count {
            color: white;
        }

        .calendar-filter-info {
            text-align: center;
            padding: 10px;
            background: var(--primary-color);
            color: white;
            border-radius: 5px;
            margin-bottom: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .calendar-filter-info button {
            background: white;
            color: #667eea;
            border: none;
            padding: 5px 15px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 13px;
        }

        .calendar-filter-info button:hover {
            background: #f0f0f0;
        }

        /* === FLOATING BUTTON === */
        .floating-btn {
            position: fixed;
            bottom: 30px;
            right: 30px;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: var(--primary-color);
            color: white;
            border: none;
            font-size: 24px;
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
            transition: all 0.3s;
            z-index: 1000;
            -webkit-tap-highlight-color: transparent;
            touch-action: manipulation;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .floating-btn:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
        }

        .floating-btn:active {
            transform: scale(0.95);
        }

        /* === PIN ENTRY MODAL === */
        .pin-modal {
            text-align: center;
        }

        .pin-modal p {
            color: #666;
            margin-bottom: 20px;
        }

        .pin-input {
            width: 200px;
            padding: 15px;
            font-size: 24px;
            text-align: center;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            margin-bottom: 20px;
            letter-spacing: 10px;
            -webkit-appearance: none;
            appearance: none;
        }

        .pin-input:focus {
            outline: none;
            border-color: var(--primary-color);
        }

        @media (max-width: 768px) {
            .pin-input {
                width: 180px;
                font-size: 20px;
                padding: 12px;
            }
        }

        .pin-error {
            color: #ff4757;
            font-size: 14px;
            margin-top: 10px;
        }

        .primary-btn {
            background: var(--primary-color);
            color: white;
        }

        .primary-btn:hover {
            background: var(--primary-dark);
        }

        /* === PARENT DASHBOARD === */
        .parent-dashboard-modal .modal-content {
            max-width: 900px;
            max-height: 90vh;
            overflow-y: auto;
        }

        .parent-dashboard-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 2px solid #e0e0e0;
        }

        .parent-dashboard-header h2 {
            margin: 0;
        }

        .close-btn {
            background: none;
            border: none;
            font-size: 28px;
            color: #999;
            cursor: pointer;
            padding: 0;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.3s;
        }

        .close-btn:hover {
            background: #f0f0f0;
            color: #333;
        }

        .dashboard-section {
            margin-bottom: 30px;
        }

        .dashboard-section h3 {
            color: var(--primary-color);
            margin-bottom: 15px;
            font-size: 18px;
        }

        .stat-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            margin-bottom: 20px;
        }

        .parent-stat-card {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 20px;
            text-align: center;
            border: 2px solid #e0e0e0;
        }

        .parent-stat-value {
            font-size: 36px;
            font-weight: 700;
            color: var(--primary-color);
            margin-bottom: 5px;
        }

        .parent-stat-label {
            font-size: 14px;
            color: #666;
        }

        .activity-list {
            max-height: 300px;
            overflow-y: auto;
        }

        .activity-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px;
            background: #f8f9fa;
            border-radius: 8px;
            margin-bottom: 8px;
        }

        .activity-text {
            flex: 1;
            font-size: 14px;
            color: #333;
        }

        .activity-time {
            font-size: 12px;
            color: #999;
        }

        .completion-bar {
            background: #e0e0e0;
            border-radius: 10px;
            height: 30px;
            overflow: hidden;
            margin-bottom: 10px;
        }

        .completion-fill {
            background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            padding-right: 10px;
            color: white;
            font-weight: 600;
            font-size: 14px;
            transition: width 0.5s ease;
        }

        .parent-settings {
            background: #f8f9fa;
            padding: 20px;
            border-radius: 10px;
        }

        .setting-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid #e0e0e0;
        }

        .setting-row:last-child {
            border-bottom: none;
        }

        .setting-label {
            font-weight: 600;
            color: #333;
        }

        .setting-input {
            padding: 8px 12px;
            border: 2px solid #e0e0e0;
            border-radius: 5px;
            width: 100px;
            text-align: center;
        }

        .export-btn {
            padding: 10px 20px;
            background: #2ecc71;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
            transition: background 0.3s;
        }

        .export-btn:hover {
            background: #27ae60;
        }

        /* === SYNC MODAL STYLES === */
        .sync-section {
            background: #f8f9fa;
            padding: 20px;
            border-radius: 10px;
        }

        .sync-section h3 {
            color: #333;
            font-size: 16px;
            margin-bottom: 10px;
        }

        #syncModal .modal-content {
            max-width: 600px;
        }

        @media (max-width: 768px) {
            #syncModal textarea {
                font-size: 11px !important;
                height: 100px !important;
            }

            .sync-section {
                padding: 15px;
            }
        }

        /* === THEME CUSTOMIZATION STYLES === */
        .theme-settings h3 {
            color: #333;
            margin-bottom: 15px;
            font-size: 16px;
        }

        .theme-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 15px;
            margin-bottom: 20px;
        }

        .theme-option {
            cursor: pointer;
            text-align: center;
            transition: transform 0.3s;
        }

        .theme-option:hover {
            transform: scale(1.05);
        }

        .theme-option.selected .theme-preview {
            border: 3px solid var(--primary-color);
            box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
        }

        .theme-preview {
            width: 100%;
            height: 80px;
            border-radius: 10px;
            margin-bottom: 8px;
            border: 3px solid transparent;
            transition: all 0.3s;
        }

        .theme-name {
            font-size: 13px;
            color: #333;
            font-weight: 500;
        }

        .emoji-info {
            background: #f8f9fa;
            padding: 15px;
            border-radius: 8px;
        }

        .emoji-info p {
            margin-bottom: 12px;
            color: #666;
            font-size: 14px;
        }

        .emoji-suggestions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .emoji-btn {
            background: white;
            border: 2px solid #e0e0e0;
            padding: 8px 12px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 13px;
            transition: all 0.3s;
            display: inline-block;
        }

        .emoji-btn:hover {
            border-color: var(--primary-color);
            background: var(--primary-color);
            color: white;
        }

        /* === GAMIFICATION STYLES === */
        .gamification-dashboard {
            background: var(--background-gradient);
            border-radius: 10px;
            padding: 20px;
            margin-bottom: 20px;
            color: white;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        }

        /* Panel theme variations */
        .gamification-dashboard.panel-blue {
            background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
        }

        .gamification-dashboard.panel-pink {
            background: linear-gradient(135deg, #ff6b9d 0%, #ffa751 100%);
        }

        .gamification-dashboard.panel-green {
            background: linear-gradient(135deg, #27ae60 0%, #16a085 100%);
        }

        .gamification-dashboard.panel-gold {
            background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
        }

        .gamification-dashboard.panel-rainbow {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
        }

        .gamification-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            user-select: none;
        }

        .gamification-header h3 {
            margin: 0;
            font-size: 20px;
        }

        .collapse-icon {
            font-size: 18px;
            transition: transform 0.3s;
        }

        .gamification-content {
            margin-top: 20px;
        }

        .gamification-stats {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 15px;
            margin-bottom: 20px;
        }

        .stat-card {
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(10px);
            border-radius: 10px;
            padding: 15px;
            text-align: center;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .stat-icon {
            font-size: 32px;
            margin-bottom: 5px;
        }

        .stat-value {
            font-size: 28px;
            font-weight: 700;
            margin-bottom: 5px;
        }

        .stat-label {
            font-size: 12px;
            opacity: 0.9;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .daily-progress {
            margin-bottom: 20px;
        }

        .progress-bar-container {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 20px;
            height: 24px;
            overflow: hidden;
            margin-bottom: 8px;
        }

        .progress-bar {
            background: linear-gradient(90deg, #2ecc71 0%, #27ae60 100%);
            height: 100%;
            border-radius: 20px;
            transition: width 0.5s ease;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            padding-right: 10px;
            color: white;
            font-weight: 600;
            font-size: 12px;
        }

        .progress-label {
            font-size: 13px;
            text-align: center;
            opacity: 0.9;
        }

        .badges-preview {
            background: rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            padding: 15px;
        }

        .badges-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
            font-weight: 600;
        }

        .view-all-badges-btn {
            background: rgba(255, 255, 255, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.3);
            color: white;
            padding: 5px 12px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 12px;
            transition: all 0.3s;
        }

        .view-all-badges-btn:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .badges-list {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .badge-item {
            display: flex;
            align-items: center;
            gap: 8px;
            background: rgba(255, 255, 255, 0.15);
            padding: 8px 12px;
            border-radius: 8px;
            font-size: 13px;
        }

        .badge-emoji {
            font-size: 20px;
        }

        .badge-name {
            font-weight: 500;
        }

        .no-badges {
            text-align: center;
            opacity: 0.7;
            padding: 10px;
            font-size: 14px;
        }

        /* Points popup animation */
        .points-popup {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: var(--background-gradient);
            color: white;
            padding: 20px 30px;
            border-radius: 15px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
            z-index: 10000;
            animation: pointsPopup 2s ease-out forwards;
            text-align: center;
        }

        .points-amount {
            font-size: 48px;
            font-weight: 700;
            margin-bottom: 5px;
        }

        .points-reason {
            font-size: 16px;
            opacity: 0.9;
        }

        @keyframes pointsPopup {
            0% {
                transform: translate(-50%, -50%) scale(0);
                opacity: 0;
            }
            10% {
                transform: translate(-50%, -50%) scale(1.2);
                opacity: 1;
            }
            20% {
                transform: translate(-50%, -50%) scale(1);
            }
            80% {
                transform: translate(-50%, -50%) scale(1);
                opacity: 1;
            }
            100% {
                transform: translate(-50%, -50%) scale(0.8);
                opacity: 0;
            }
        }

        /* Badge unlock modal styles */
        .badge-unlock-modal {
            z-index: 10001;
        }

        .badge-unlock-content {
            text-align: center;
            animation: badgeUnlock 0.5s ease-out;
        }

        .badge-unlock-emoji {
            font-size: 80px;
            margin-bottom: 15px;
            animation: badgeSpin 0.6s ease-out;
        }

        @keyframes badgeUnlock {
            0% {
                transform: scale(0) rotate(-180deg);
                opacity: 0;
            }
            100% {
                transform: scale(1) rotate(0);
                opacity: 1;
            }
        }

        @keyframes badgeSpin {
            0% {
                transform: rotate(0deg) scale(0);
            }
            50% {
                transform: rotate(180deg) scale(1.2);
            }
            100% {
                transform: rotate(360deg) scale(1);
            }
        }

        .modal-close-btn {
            padding: 12px 30px;
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: 5px;
            font-size: 16px;
            cursor: pointer;
            margin-top: 20px;
            transition: background 0.3s;
        }

        .modal-close-btn:hover {
            background: var(--primary-dark);
        }

        /* Confetti animation */
        .confetti {
            position: fixed;
            width: 10px;
            height: 10px;
            top: -10px;
            z-index: 9999;
            animation: confettiFall linear forwards;
        }

        @keyframes confettiFall {
            to {
                transform: translateY(100vh) rotate(360deg);
                opacity: 0;
            }
        }

        /* Badges modal */
        .badges-modal-content {
            max-width: 600px;
            max-height: 80vh;
            overflow-y: auto;
        }

        .badges-progress {
            text-align: center;
            color: #666;
            margin-bottom: 20px;
            font-size: 14px;
        }

        .badge-category {
            margin-bottom: 25px;
        }

        .badge-category h4 {
            color: var(--primary-color);
            margin-bottom: 15px;
            font-size: 16px;
            border-bottom: 2px solid #e0e0e0;
            padding-bottom: 8px;
        }

        .badge-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 15px;
        }

        .badge-card {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 15px;
            text-align: center;
            transition: all 0.3s;
        }

        .badge-card.earned {
            background: linear-gradient(135deg, color-mix(in srgb, var(--primary-color) 8%, transparent) 0%, color-mix(in srgb, var(--secondary-color) 8%, transparent) 100%);
            border: 2px solid var(--primary-color);
        }

        .badge-card.locked {
            opacity: 0.5;
        }

        .badge-card-emoji {
            font-size: 40px;
            margin-bottom: 8px;
        }

        .badge-card-name {
            font-weight: 600;
            color: #333;
            font-size: 13px;
            margin-bottom: 5px;
        }

        .badge-card-desc {
            font-size: 11px;
            color: #666;
            line-height: 1.3;
        }

        @media (max-width: 1024px) {
            .main-layout {
                flex-direction: column;
            }

            .calendar-section {
                flex: 1;
                width: 100%;
                position: static;
                margin-bottom: 30px;
            }

            .todo-section {
                width: 100%;
            }

            .gamification-stats {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 768px) {
            .gamification-stats {
                grid-template-columns: repeat(3, 1fr);
                gap: 8px;
            }

            .stat-card {
                padding: 10px;
            }

            .stat-icon {
                font-size: 24px;
            }

            .stat-value {
                font-size: 20px;
            }

            .stat-label {
                font-size: 10px;
            }

            .filters {
                flex-wrap: wrap;
            }

            .filter-btn {
                padding: 6px 12px;
                font-size: 13px;
            }

            .sort-controls {
                flex-wrap: wrap;
            }

            .sort-btn {
                padding: 5px 10px;
                font-size: 12px;
            }

            .floating-btn {
                width: 56px;
                height: 56px;
                bottom: 20px;
                right: 20px;
                font-size: 22px;
                z-index: 9999;
            }

            .todo-item {
                flex-direction: column;
                align-items: stretch;
            }

            .todo-meta {
                flex-direction: column;
                gap: 5px;
            }

            .delete-btn {
                margin-left: 0;
                margin-top: 10px;
                align-self: stretch;
            }

            .calendar-section {
                margin-bottom: 20px;
            }

            .view-toggle-btn {
                font-size: 13px;
                padding: 6px 12px;
            }

            .calendar-day {
                padding: 2px;
            }

            .calendar-day-number {
                font-size: 12px;
            }

            .calendar-task-count {
                font-size: 8px;
            }

            .badge-grid {
                grid-template-columns: repeat(2, 1fr);
            }

            .modal-content {
                width: 95%;
                max-height: 85vh;
                overflow-y: auto;
                padding: 20px;
            }

            .badges-modal-content {
                max-height: 80vh;
            }

            .parent-dashboard-content {
                max-height: 85vh;
            }

            .theme-grid {
                grid-template-columns: repeat(2, 1fr);
            }

            .emoji-suggestions {
                gap: 6px;
            }

            .emoji-btn {
                padding: 6px 10px;
                font-size: 12px;
            }
        }

        @media (max-width: 480px) {
            .gamification-stats {
                grid-template-columns: 1fr;
            }

            .stat-grid {
                grid-template-columns: 1fr;
            }

            .theme-grid {
                grid-template-columns: 1fr;
            }
        }

/* ===================================
   Notes Section Styles
   =================================== */

.main-nav {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
}

.main-nav-btn {
    padding: 12px 30px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

.main-nav-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.main-nav-btn:hover:not(.active) {
    background: #f0f0f0;
    border-color: #ccc;
}

/* Notes Layout */
.notes-layout {
    display: flex;
    gap: 20px;
    height: calc(100vh - 250px);
    min-height: 600px;
}

.notes-sidebar {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    border-right: 2px solid #e0e0e0;
    padding-right: 20px;
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.notes-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.new-note-btn {
    padding: 8px 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
}

.new-note-btn:hover {
    background: var(--primary-dark);
}

.notes-search {
    margin-bottom: 15px;
}

.notes-search input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.notes-search input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.notes-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.note-list-item {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.note-list-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.note-list-item.active {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.note-list-item-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 15px;
}

.note-list-item-preview {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.note-list-item-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: #999;
}

.note-list-item-badge {
    padding: 2px 6px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 11px;
}

.empty-notes-list {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

/* Note Editor */
.note-editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.empty-note-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
}

.empty-note-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-note-state h3 {
    margin: 0 0 10px 0;
    color: #666;
}

.empty-note-state p {
    margin: 0;
    font-size: 14px;
}

.note-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.note-editor-toolbar {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.toolbar-btn {
    padding: 8px 15px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.toolbar-btn:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.toolbar-btn.danger {
    color: #e74c3c;
}

.toolbar-btn.danger:hover {
    background: #fee;
    border-color: #e74c3c;
}

.toolbar-divider {
    width: 2px;
    background: #e0e0e0;
    margin: 0 5px;
}

.note-editor-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.note-title-input {
    width: 100%;
    padding: 15px;
    border: none;
    border-bottom: 2px solid #e0e0e0;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.note-title-input:focus {
    outline: none;
    border-bottom-color: var(--primary-color);
}

.note-content-input {
    flex: 1;
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    resize: none;
    font-family: inherit;
    box-sizing: border-box;
}

.note-content-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.note-attachments {
    margin-top: 20px;
}

.attachments-section {
    margin-bottom: 20px;
}

.attachments-section h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.photo-attachments {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.photo-attachment {
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

.photo-attachment img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s;
}

.photo-attachment img:hover {
    transform: scale(1.05);
}

.delete-attachment-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 25px;
    height: 25px;
    border: none;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.delete-attachment-btn:hover {
    background: #e74c3c;
}

.audio-attachments {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.audio-attachment {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
}

.audio-attachment audio {
    flex: 1;
}

.audio-attachment .delete-attachment-btn {
    position: static;
    flex-shrink: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .main-nav {
        gap: 5px;
        padding: 8px;
    }

    .main-nav-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .notes-layout {
        flex-direction: column;
        height: auto;
        min-height: auto;
    }

    .notes-sidebar {
        flex: 0 0 auto;
        border-right: none;
        border-bottom: 2px solid #e0e0e0;
        padding-right: 0;
        padding-bottom: 15px;
        margin-bottom: 15px;
        max-height: 300px;
    }

    .notes-list {
        max-height: 200px;
    }

    .note-editor-toolbar {
        gap: 5px;
    }

    .toolbar-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .note-title-input {
        font-size: 20px;
        padding: 12px;
    }

    .note-content-input {
        font-size: 14px;
        padding: 12px;
    }

    .photo-attachments {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* OCR Loading Spinner */
.ocr-loading-modal .modal-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
}

.ocr-loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.ocr-loading-modal h3 {
    color: #333;
    margin: 20px 0 10px 0;
}

.ocr-loading-modal p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

/* Voice Input Listening Animation */
.toolbar-btn.listening {
    animation: pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

.toolbar-btn.listening:hover {
    background: #c0392b !important;
}

/* Voice Recording Animation */
.toolbar-btn.recording {
    animation: record-pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
}

@keyframes record-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(231, 76, 60, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

.toolbar-btn.recording:hover {
    background: #c0392b !important;
}

/* ===================================
   Sidebar Navigation Styles
   =================================== */

body {
    margin: 0;
    padding: 0;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-left: 4px solid white;
}

.sidebar-icon {
    font-size: 24px;
    margin-right: 15px;
    width: 30px;
    text-align: center;
}

.sidebar-text {
    font-size: 16px;
    font-weight: 500;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1100;
    width: 50px;
    height: 50px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.mobile-menu-toggle:hover {
    background: var(--primary-dark);
}

/* Main Wrapper */
.main-wrapper {
    margin-left: 250px;
    min-height: 100vh;
}

/* Page Content */
.page-content {
    min-height: calc(100vh - 40px);
    padding: 20px;
}

/* About Page Styles */
.about-container {
    max-width: 1200px;
    margin: 0 auto;
}

.about-container h1 {
    text-align: center;
    color: #333;
    margin-bottom: 40px;
    font-size: 36px;
}

.about-content {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.about-section {
    margin-bottom: 40px;
}

.about-section:last-child {
    margin-bottom: 0;
}

.about-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 28px;
}

.about-section p {
    color: #666;
    line-height: 1.8;
    font-size: 16px;
    margin-bottom: 15px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.feature-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.feature-card h3 {
    color: #333;
    margin: 15px 0 10px 0;
    font-size: 20px;
}

.feature-card p {
    color: #666;
    font-size: 14px;
    margin: 0;
    line-height: 1.6;
}

.getting-started-list,
.tips-list {
    color: #666;
    line-height: 1.8;
    font-size: 16px;
    padding-left: 25px;
}

.getting-started-list li,
.tips-list li {
    margin-bottom: 10px;
}

/* Contact Page Styles */
.contact-container {
    max-width: 900px;
    margin: 0 auto;
}

.contact-container h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 36px;
}

.contact-content {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.contact-intro {
    text-align: center;
    margin-bottom: 40px;
}

.contact-intro p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.contact-note {
    background: #fff3cd;
    padding: 10px 15px;
    border-radius: 5px;
    color: #856404;
    font-size: 14px;
    display: inline-block;
}

.contact-form-section h2 {
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 24px;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-submit-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.contact-submit-btn:hover {
    background: var(--primary-dark);
}

.contact-inbox-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.contact-inbox-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 24px;
}

.contact-messages-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-message-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid var(--primary-color);
}

.contact-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.contact-message-from {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.contact-message-date {
    font-size: 12px;
    color: #999;
}

.contact-message-subject {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 15px;
}

.contact-message-email {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.contact-message-text {
    color: #666;
    line-height: 1.6;
    font-size: 14px;
}

.empty-messages {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .page-content {
        padding: 80px 15px 20px 15px;
    }

    .about-content,
    .contact-content {
        padding: 20px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .contact-form {
        max-width: 100%;
    }
}

/* Sidebar Footer (Settings Button) */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-settings-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}

.sidebar-settings-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-settings-btn .sidebar-icon {
    margin-right: 15px;
}

/* Settings Modal */
.settings-modal-content {
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
}

.settings-sections {
    margin-top: 20px;
}

.settings-section {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
}

.settings-section p {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.settings-action-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
}

.settings-action-btn:hover {
    background: var(--primary-dark);
}

/* Designer Section */
.designer-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 30px !important;
    text-align: center;
}

.designer-credit {
    max-width: 600px;
    margin: 0 auto;
}

.designer-credit p {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
}

.designer-credit strong {
    color: var(--primary-color);
    font-size: 18px;
}

.designer-note {
    font-style: italic;
    color: #666 !important;
    font-size: 14px !important;
}

/* Mobile adjustments for sidebar footer */
@media (max-width: 768px) {
    .sidebar-footer {
        position: relative;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
}

/* Settings Modal with Sidebar */
.settings-modal .modal-content {
    max-width: 1000px !important;
    width: 95%;
    height: 85vh;
    max-height: 85vh;
    padding: 0;
    overflow: hidden;
}

.settings-modal-content-wide {
    max-width: 1000px;
    width: 95%;
    height: 85vh;
    max-height: 85vh;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.settings-modal-content-wide .close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.settings-layout {
    display: flex;
    height: 100%;
    overflow: hidden;
}

.settings-sidebar {
    width: 250px;
    background: #f8f9fa;
    border-right: 2px solid #e0e0e0;
    padding: 30px 0;
    overflow-y: auto;
}

.settings-sidebar h2 {
    margin: 0 0 20px 0;
    padding: 0 20px;
    font-size: 24px;
    color: #333;
}

.settings-nav {
    display: flex;
    flex-direction: column;
}

.settings-nav-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.settings-nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #333;
}

.settings-nav-link.active {
    background: white;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.settings-nav-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 25px;
    text-align: center;
}

.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px 40px;
}

.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
}

.settings-panel h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 28px;
}

.settings-panel h4 {
    margin: 20px 0 15px 0;
    color: #333;
    font-size: 18px;
}

.settings-panel-content {
    margin-top: 20px;
}

.settings-panel-content p {
    line-height: 1.6;
}

.settings-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.primary-btn {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.primary-btn:hover {
    background: var(--primary-dark);
}

.secondary-btn {
    padding: 12px 24px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.secondary-btn:hover {
    background: #7f8c8d;
}

/* Mobile Responsive for Settings */
@media (max-width: 768px) {
    .settings-modal-content-wide {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .settings-layout {
        flex-direction: column;
    }

    .settings-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid #e0e0e0;
        padding: 20px 0;
        max-height: 200px;
        overflow-y: auto;
    }

    .settings-sidebar h2 {
        font-size: 20px;
    }

    .settings-nav {
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
    }

    .settings-nav-link {
        flex-direction: column;
        text-align: center;
        padding: 10px;
        border-left: none;
        border-bottom: 3px solid transparent;
        min-width: 80px;
    }

    .settings-nav-link.active {
        border-left: none;
        border-bottom-color: var(--primary-color);
    }

    .settings-nav-icon {
        margin-right: 0;
        margin-bottom: 5px;
        font-size: 24px;
    }

    .settings-content {
        padding: 20px;
    }

    .settings-panel h3 {
        font-size: 22px;
    }
}

/* ===================================
   Mobile & iPhone Fixes
   =================================== */

/* Ensure consistent page widths across all sections */
.container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.page-content {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.main-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Fix for iPhone and small screens */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }

    body {
        padding: 0 !important;
    }

    .container {
        width: 100%;
        max-width: 100vw;
        padding: 10px;
        margin: 0;
        box-sizing: border-box;
        border-radius: 0;
    }

    .main-wrapper {
        margin-left: 0;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .page-content {
        padding: 70px 10px 20px 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* About page mobile */
    .about-container {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }

    .about-content {
        padding: 15px;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .about-section {
        margin-bottom: 25px;
    }

    /* Contact page mobile */
    .contact-container {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }

    .contact-content {
        padding: 15px;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }

    /* Tasks page mobile - ensure main-layout doesn't overflow */
    .main-layout {
        width: 100%;
        max-width: 100%;
        padding: 0;
        box-sizing: border-box;
    }

    .calendar-section,
    .todo-section {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Notes page mobile */
    .notes-layout {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Header mobile fixes */
    .header-container {
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .header-container h1 {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .header-buttons {
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-buttons button {
        font-size: 13px;
        padding: 8px 12px;
    }

    /* Mobile menu toggle positioning */
    .mobile-menu-toggle {
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1100;
    }

    /* Sidebar mobile */
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1050;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Settings modal mobile fixes */
    .settings-modal-content-wide {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .settings-layout {
        flex-direction: column;
        height: 100%;
    }

    .settings-sidebar {
        width: 100%;
        max-height: 150px;
        border-right: none;
        border-bottom: 2px solid #e0e0e0;
        padding: 10px 0;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
    }

    .settings-sidebar h2 {
        display: none; /* Hide "Settings" title on mobile to save space */
    }

    .settings-nav {
        flex-direction: row;
        display: flex;
    }

    .settings-nav-link {
        flex-direction: column;
        padding: 10px 15px;
        border-left: none;
        border-bottom: 3px solid transparent;
        min-width: 80px;
        flex-shrink: 0;
    }

    .settings-nav-link.active {
        border-left: none;
        border-bottom-color: var(--primary-color);
    }

    .settings-nav-icon {
        margin-right: 0;
        margin-bottom: 5px;
        font-size: 22px;
    }

    .settings-content {
        flex: 1;
        padding: 15px;
        overflow-y: auto;
    }

    .settings-panel h3 {
        font-size: 20px;
    }

    .settings-panel h4 {
        font-size: 16px;
    }

    /* Theme grid mobile */
    .theme-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Color settings mobile */
    .color-setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .color-setting-item input[type="color"] {
        width: 100%;
        height: 50px;
    }

    /* Emoji suggestions mobile */
    .emoji-suggestions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .emoji-btn {
        padding: 10px;
        font-size: 14px;
    }

    /* Contact form mobile */
    .form-group input,
    .form-group textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    /* Notes list mobile */
    .notes-sidebar {
        max-height: 250px;
    }

    .note-editor-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .toolbar-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* Gamification dashboard mobile */
    .gamification-dashboard {
        width: 100%;
        box-sizing: border-box;
    }

    /* Fix floating button position on mobile */
    #parentViewBtn {
        bottom: 80px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    /* Ensure modals fit on mobile */
    .modal {
        padding: 0;
    }

    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 10px auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Fix calendar on mobile */
    .calendar-container {
        width: 100%;
        box-sizing: border-box;
    }

    .calendar-grid {
        width: 100%;
        box-sizing: border-box;
    }

    .calendar-day {
        font-size: 12px;
        min-height: 45px;
    }

    /* Input form mobile */
    .input-container {
        width: 100%;
        box-sizing: border-box;
    }

    .input-row {
        width: 100%;
        box-sizing: border-box;
    }

    #todoInput,
    #deadlineInput,
    #assigneeInput {
        width: 100%;
        box-sizing: border-box;
        font-size: 16px; /* Prevent iOS zoom */
    }

    /* Fix todo list mobile */
    .todo-list {
        width: 100%;
        box-sizing: border-box;
    }

    .todo-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .todo-content {
        width: 100%;
    }

    /* Prevent horizontal scroll */
    * {
        max-width: 100%;
    }

    img {
        max-width: 100%;
        height: auto;
    }
}

/* Extra small screens (iPhone SE, etc.) */
@media (max-width: 375px) {
    .header-container h1 {
        font-size: 18px;
    }

    .mobile-menu-toggle {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .page-content {
        padding: 65px 8px 15px 8px;
    }

    .about-content,
    .contact-content {
        padding: 10px;
    }

    .theme-grid {
        grid-template-columns: 1fr;
    }

    .settings-nav-link {
        min-width: 70px;
        padding: 8px 10px;
        font-size: 12px;
    }

    .settings-nav-icon {
        font-size: 20px;
    }
}

/* ==========================================
   Posts Page Styles
   ========================================== */

/* Posts List */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 25px;
}

.post-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.post-title {
    margin: 0;
    font-size: 24px;
    color: #2c3e50;
    flex: 1;
}

.post-actions {
    display: flex;
    gap: 8px;
}

.post-action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.post-action-btn:hover {
    background: var(--primary-color-dark);
}

.post-action-btn.delete {
    background: #e74c3c;
}

.post-action-btn.delete:hover {
    background: #c0392b;
}

.post-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 15px;
}

.post-content-preview {
    color: #34495e;
    line-height: 1.6;
    margin-bottom: 15px;
    white-space: pre-wrap;
}

.post-footer {
    display: flex;
    justify-content: flex-end;
}

.btn-view-post {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-view-post:hover {
    background: var(--primary-color-dark);
}

/* Post Editor Modal */
.post-editor-modal {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

.post-editor-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #2c3e50;
}

.form-input {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-textarea {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Media Section */
.post-media-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.post-media-section h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
}

.media-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.media-btn {
    padding: 10px 16px;
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.media-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Media Preview */
.post-media-preview {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.media-preview-item {
    position: relative;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.media-preview-item img {
    max-width: 100%;
    border-radius: 5px;
}

.media-preview-item audio {
    width: 100%;
    margin-top: 10px;
}

.media-preview-item iframe {
    width: 100%;
    height: 300px;
    border-radius: 5px;
}

.audio-preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.video-preview iframe {
    width: 100%;
    height: 400px;
}

.remove-media-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.remove-media-btn:hover {
    background: #c0392b;
}

/* Video Embed Section */
.video-embed-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.video-embed-section label {
    font-weight: 600;
    color: #2c3e50;
}

.btn-small {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-small:hover {
    background: var(--primary-color-dark);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    padding: 10px 20px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-primary {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-color-dark);
}

/* Post View Modal */
.post-view-modal {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

.post-full {
    margin-bottom: 30px;
}

.post-full .post-title {
    font-size: 32px;
    margin-bottom: 15px;
}

.post-content-full {
    color: #2c3e50;
    line-height: 1.8;
    font-size: 16px;
    margin: 20px 0;
    white-space: pre-wrap;
}

/* Post Media in View */
.post-media {
    margin: 25px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-image {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-audio {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.post-audio audio {
    width: 100%;
}

.post-video {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.post-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Comments Section */
.comments-section {
    margin-top: 40px;
    border-top: 2px solid #e0e0e0;
    padding-top: 30px;
}

.comments-section h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
}

.comment-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.comment-form .form-group {
    margin-bottom: 15px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 600;
    color: #2c3e50;
}

.comment-date {
    font-size: 14px;
    color: #7f8c8d;
}

.comment-text {
    color: #34495e;
    line-height: 1.6;
    margin-bottom: 10px;
}

.reply-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.reply-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Reply Form */
.reply-form {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.reply-form .form-input,
.reply-form .form-textarea {
    margin-bottom: 10px;
}

.reply-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Comment Replies */
.comment-replies {
    margin-top: 15px;
    margin-left: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-reply {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.no-comments {
    text-align: center;
    color: #7f8c8d;
    padding: 40px 20px;
    font-style: italic;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    font-size: 18px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .post-header {
        flex-direction: column;
        gap: 10px;
    }

    .post-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .post-title {
        font-size: 20px;
    }

    .post-full .post-title {
        font-size: 24px;
    }

    .post-meta {
        flex-direction: column;
        gap: 5px;
    }

    .media-buttons {
        flex-direction: column;
    }

    .media-btn {
        width: 100%;
    }

    .post-editor-modal,
    .post-view-modal {
        max-width: 95%;
        margin: 10px;
    }

    .comment-replies {
        margin-left: 15px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions button {
        width: 100%;
    }

    .reply-actions {
        flex-direction: column;
    }

    .reply-actions button {
        width: 100%;
    }
}

/* Post Title Wrapper and Privacy Badge */
.post-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    flex-wrap: wrap;
}

.privacy-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #e74c3c;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Important Note Box in About Page */
.important-note {
    display: flex;
    gap: 20px;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin: 20px 0;
}

.note-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.note-content h3 {
    margin: 0 0 10px 0;
    font-size: 22px;
    color: white;
}

.note-content p {
    margin: 10px 0;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
}

.note-content strong {
    color: #fff;
    font-weight: 700;
}

@media (max-width: 768px) {
    .important-note {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
        text-align: center;
    }

    .note-icon {
        font-size: 36px;
    }

    .note-content h3 {
        font-size: 18px;
    }

    .note-content p {
        font-size: 14px;
    }
}

/* General Button Styles */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

#newPostSection {
    margin-bottom: 25px;
}

#newPostBtn {
    font-size: 16px;
    font-weight: 600;
}
