/* ========================================
   CSS Variables for Theme Support
   ======================================== */
:root {
    /* Light Mode Colors */
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-muted: #a0aec0;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.12);
    
    /* Accent Colors */
    --primary: #4299e1;
    --primary-hover: #3182ce;
    --success: #48bb78;
    --success-hover: #38a169;
    --warning: #ed8936;
    --warning-hover: #dd6b20;
    --danger: #f56565;
    --danger-hover: #e53e3e;
    --secondary: #718096;
    --secondary-hover: #4a5568;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    
    /* Transitions */
    --transition: all 0.3s ease;
}

/* Dark Mode Variables */
body.dark-mode {
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-card: #2d3748;
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #a0aec0;
    --border-color: #4a5568;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* ========================================
   Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   Floating Buttons
   ======================================== */
.floating-theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-hover);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 1000;
}

.floating-theme-toggle:hover {
    transform: scale(1.1) rotate(20deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.floating-fileshare-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    box-shadow: var(--shadow-hover);
    font-size: 2rem;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 1000;
}

.floating-fileshare-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.floating-add-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--success));
    border: none;
    box-shadow: var(--shadow-hover);
    font-size: 2rem;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 1000;
}

.floating-add-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 12px 35px rgba(66, 153, 225, 0.4);
}

.floating-back-btn {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-hover);
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 1000;
    color: var(--text-primary);
}

.floating-back-btn:hover {
    transform: scale(1.1) translateX(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background: var(--secondary);
    color: white;
}

.data-buttons-container {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.data-buttons-toggle {
    width: 2.75rem;
    height: 2.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.data-buttons-toggle:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.fileshare-toggle-btn {
    position: fixed;
    top: 4.75rem;
    left: 1.5rem;
    width: 2.75rem;
    height: 2.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1000;
}

.fileshare-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.data-buttons {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transform: translateX(-10px);
    pointer-events: none;
    transition: all 0.3s ease;
}

.data-buttons-container:hover .data-buttons {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.btn-data {
    padding: 0.625rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.btn-data:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-data:active {
    transform: translateY(0);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: clamp(0.75rem, 1.5vw, 0.9rem);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn:active {
    transform: translateY(0);
}

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

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

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

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

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

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

.btn-success:disabled {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-success:disabled:hover {
    background: var(--bg-secondary);
    transform: none;
}

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

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

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

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

.btn-icon {
    padding: 0.625rem;
    font-size: 1.25rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-large {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ========================================
   Dashboard Grid
   ======================================== */
.dashboard {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: var(--spacing-lg);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: var(--spacing-sm);
    height: 100vh;
    max-height: 100vh;
    box-sizing: border-box;
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--spacing-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

/* Split Card Container */
.card-split-container {
    display: flex;
    gap: var(--spacing-sm);
    height: 100%;
    min-height: 0;
}

.card-half {
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.card-half .card-title {
    font-size: 0.95rem;
}

.card-half .card-body {
    font-size: 0.9rem;
    flex: 1;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    flex-shrink: 0;
}

.card-title {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-count {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    min-width: 1.5rem;
    text-align: center;
}

.card-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    min-height: 0;
    max-height: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.card-body::-webkit-scrollbar {
    width: 4px;
}

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

.card-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.empty-state {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 1rem 0;
    font-size: clamp(0.8rem, 1.5vw, 0.95rem);
}

/* ========================================
   Items
   ======================================== */
.item {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    border-left: 3px solid var(--primary);
    transition: var(--transition);
    animation: slideIn 0.3s ease;
    font-size: 0.85rem;
    flex-shrink: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.item:hover {
    background: var(--bg-secondary);
    transform: translateX(5px);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.375rem;
}

.item-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    flex: 1;
    line-height: 1.3;
}

.item.completed .item-title {
    text-decoration: line-through;
    opacity: 0.6;
}

.item-actions {
    display: flex;
    gap: 0.25rem;
}

.item-action {
    background: none;
    border: none;
    font-size: clamp(0.85rem, 2vw, 1rem);
    cursor: pointer;
    padding: 0.2rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    opacity: 0.7;
    flex-shrink: 0;
}

.item-action:hover {
    opacity: 1;
    transform: scale(1.2);
}

.item-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.date-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.time-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    border: 1px solid var(--border-color);
}

/* ========================================
   Priority Selector
   ======================================== */
.priority-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.priority-option {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.priority-option input[type="radio"] {
    display: none;
}

.priority-badge {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    border: 2px solid transparent;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.priority-option input:checked + .priority-badge {
    border-color: currentColor;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.priority-badge:hover {
    transform: scale(1.05);
}

.priority-1 {
    background: #fee2e2;
    color: #991b1b;
}

.priority-2 {
    background: #fed7aa;
    color: #9a3412;
}

.priority-3 {
    background: #dbeafe;
    color: #1e40af;
}

.priority-4 {
    background: #dcfce7;
    color: #166534;
}

.priority-none {
    background: var(--bg-primary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

body.dark-mode .priority-1 {
    background: #991b1b;
    color: #fee2e2;
}

body.dark-mode .priority-2 {
    background: #9a3412;
    color: #fed7aa;
}

body.dark-mode .priority-3 {
    background: #1e40af;
    color: #dbeafe;
}

body.dark-mode .priority-4 {
    background: #166534;
    color: #dcfce7;
}

.priority-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.priority-indicator.p1 { background: #ef4444; }
.priority-indicator.p2 { background: #f97316; }
.priority-indicator.p3 { background: #3b82f6; }
.priority-indicator.p4 { background: #22c55e; }

/* Edit mode styles */
.item.edit-mode {
    background: var(--bg-secondary);
    border-left-color: var(--primary);
    border-left-width: 4px;
}

.item-edit-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.item-edit-form input,
.item-edit-form textarea {
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
}

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

.item-edit-form textarea {
    resize: vertical;
    min-height: 50px;
}

.item-edit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.date-upcoming {
    background: #fef3c7;
    color: #92400e;
}

.date-today {
    background: #dcfce7;
    color: #166534;
}

.date-overdue {
    background: #fee2e2;
    color: #991b1b;
}

body.dark-mode .date-upcoming {
    background: #78350f;
    color: #fef3c7;
}

body.dark-mode .date-today {
    background: #166534;
    color: #dcfce7;
}

body.dark-mode .date-overdue {
    background: #991b1b;
    color: #fee2e2;
}

/* ========================================
   Modal Popup
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    line-height: 1;
}

.modal-close:hover {
    background: var(--bg-primary);
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    max-height: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

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

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

.modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.modal-body .item {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
}

.modal-body .empty-state {
    padding: 3rem 1rem;
    font-size: 1rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.modal-footer .btn {
    width: 100%;
}

.modal-add-form {
    padding: 1.5rem;
    border-top: 2px solid var(--border-color);
    background: var(--bg-primary);
    animation: slideIn 0.3s ease;
    overflow-y: auto;
    max-height: 50vh;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.modal-add-form::-webkit-scrollbar {
    width: 6px;
}

.modal-add-form::-webkit-scrollbar-track {
    background: transparent;
}

.modal-add-form::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.modal-add-form h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.modal-add-form .form-group {
    margin-bottom: 1rem;
}

.modal-add-form .form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.modal-add-form .form-actions .btn {
    flex: 1;
}

/* Make cards clickable */
.card {
    cursor: pointer;
    user-select: none;
}

.card:active {
    transform: scale(0.98);
}

.card-timer {
    cursor: default;
}

.card-timer:active {
    transform: translateY(-4px);
}

/* ========================================
   Timer Card
   ======================================== */
.timer-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.5rem;
    height: 100%;
    overflow: hidden;
}

.timer-display {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 700;
    color: var(--primary);
    font-family: 'Courier New', monospace;
    text-align: center;
    letter-spacing: 0.05rem;
    margin: 0;
}

.timer-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    justify-content: center;
    width: 100%;
}

.timer-controls .btn {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.5rem;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    white-space: nowrap;
}

/* ========================================
   Add Item Form
   ======================================== */
.add-page {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: var(--spacing-lg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--spacing-xl);
    border: 1px solid var(--border-color);
}

.add-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row .form-group {
    margin: 0;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-group input[type="date"],
.form-group input[type="time"] {
    cursor: pointer;
    min-width: 0;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator,
.form-group input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(0.5);
}

body.dark-mode .form-group input[type="date"]::-webkit-calendar-picker-indicator,
body.dark-mode .form-group input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

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

.form-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.form-actions .btn {
    flex: 1;
}

.success-message {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: #d1fae5;
    color: #065f46;
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 600;
    animation: slideIn 0.3s ease;
}

body.dark-mode .success-message {
    background: #065f46;
    color: #d1fae5;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet */
@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        padding: 1rem;
        height: auto;
        max-height: none;
    }
    
    .card-split-container {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .card {
        min-height: 250px;
    }
    
    .timer-display {
        font-size: 2rem;
    }
    
    .timer-controls .btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .floating-theme-toggle {
        top: 0.5rem;
        right: 0.5rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
        z-index: 2000;
    }
    
    .floating-add-btn {
        display: none;
    }
    
    .floating-back-btn {
        display: none;
    }
    
    .data-buttons-container {
        top: 0.5rem;
        left: 0.5rem;
        z-index: 2000;
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }
    
    .data-buttons-toggle {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    
    .fileshare-toggle-btn {
        position: fixed !important;
        top: 0.5rem !important;
        right: 0.5rem !important;
        left: auto !important;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
        z-index: 2000;
    }
    
    .data-buttons {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .data-buttons-container:hover .data-buttons {
        transform: translateX(0);
    }
    
    .btn-data {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
    }
    
    .floating-fileshare-btn {
        display: none;
    }
    
    .dashboard {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(5, 1fr);
        gap: 0.5rem;
        padding: 3.5rem 0.5rem 3.5rem 0.5rem;
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .card-split-container {
        display: contents;
    }
    
    /* Show individual cards on mobile */
    .card {
        min-height: 0;
        height: 100%;
        padding: 0.75rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        cursor: pointer;
    }
    
    .card:hover {
        transform: scale(1.02);
    }
    
    /* Hide card body content on mobile */
    .card .card-body {
        display: none;
    }
    
    /* Simplify card header for mobile */
    .card .card-header {
        margin: 0;
        padding: 0;
        border: none;
        flex-direction: column;
        gap: 0.25rem;
        width: 100%;
    }
    
    .card .card-title {
        font-size: 0.85rem;
        font-weight: 700;
        margin: 0;
    }
    
    .card .count {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--primary);
    }
    
    /* Timer card - show timer display and controls on mobile */
    .card-timer .card-body {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
    }
    
    .card-timer .timer-display {
        font-size: 1.1rem;
        margin: 0;
        font-weight: 700;
    }
    
    .card-timer .timer-controls {
        display: flex;
        gap: 0.25rem;
        width: 100%;
        justify-content: center;
        flex-wrap: nowrap;
    }
    
    .card-timer .timer-controls .btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.7rem;
        flex: 1;
        min-width: 0;
        white-space: nowrap;
    }
    
    .card-timer .card-header {
        display: none;
    }
    
    .form-container {
        padding: var(--spacing-md);
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 1rem;
    }
    
    .priority-selector {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .priority-badge {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .item-title {
        font-size: 0.875rem;
    }
    
    .timer-display {
        font-size: 1.75rem;
    }
    
    .timer-controls {
        gap: 0.5rem;
    }
    
    .timer-controls .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1rem;
        max-height: 60vh;
    }
    
    .modal-footer {
        padding: 1rem;
    }
    
    .modal-add-form {
        padding: 1rem;
        max-height: 45vh
        padding: 1rem;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
    }
    
    .modal-add-form {
        padding: 1rem;
    }
}

/* ========================================
   Animations & Effects
   ======================================== */

/* Fade in animation for page load */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease;
}

/* Stagger animation for cards */
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }
.card:nth-child(7) { animation-delay: 0.35s; }
.card:nth-child(8) { animation-delay: 0.4s; }
.card:nth-child(9) { animation-delay: 0.45s; }

/* Pulse animation for timer running */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.timer-display.running {
    animation: pulse 2s ease-in-out infinite;
    color: var(--success);
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .header-actions,
    .item-actions,
    .footer {
        display: none;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
/* Add these styles after .btn-data:active in style.css */

/* ========================================
   Notification
   ======================================== */
.notification {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    z-index: 3000;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
    min-width: 300px;
    text-align: center;
}

.notification.show {
    top: 2rem;
}

.notification-success {
    border-color: var(--success);
    background: var(--success);
    color: white;
}

.notification-error {
    border-color: var(--danger);
    background: var(--danger);
    color: white;
}

.notification-info {
    border-color: var(--primary);
}

/* Add to mobile section around line 1089 */
@media (max-width: 768px) {
    .notification {
        min-width: 250px;
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}
/* ========================================
   File Sharing Styles
   ======================================== */

/* File Share Card */
.card-fileshare {
    position: relative;
}

.fileshare-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

/* File Items List */
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.file-item:hover {
    background: var(--bg-secondary);
    transform: translateX(2px);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.file-icon {
    font-size: 1.5rem;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg-primary);
    transform: scale(1.1);
}

.btn-icon.btn-danger:hover {
    background: var(--danger);
    color: white;
}

/* File Share Overlay */
.fileshare-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.fileshare-modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.fileshare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.fileshare-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.3rem;
}

.share-content {
    padding: 1.5rem;
}

/* Room Code Section */
.room-code-section {
    text-align: center;
}

.room-code-section h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.share-instruction {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.code-input-container {
    display: flex;
    gap: 0.2rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.room-code-input {
    width: 130px;
    padding: 1rem;
    font-size: 1.8rem;
    text-align: center;
    letter-spacing: 0.3em;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 700;
    font-family: 'Courier New', monospace;
    transition: var(--transition);
}

.room-code-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.connection-status {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* File Transfer Section */
.file-transfer-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

.file-select-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.file-select-area h4 {
    color: var(--text-primary);
    margin: 0;
}

.file-input {
    padding: 0.75rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    cursor: pointer;
    transition: var(--transition);
}

.file-input:hover {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.file-info-box {
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.progress-area {
    margin-top: 1rem;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 30px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.progress-text {
    text-align: center;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .fileshare-modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .qr-container {
        flex-direction: column;
    }
    
    .fileshare-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-sm {
        width: 100%;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .file-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Grid adjustment for 10 cards (3x3 + 1 full-width) */
@media (min-width: 769px) {
    .dashboard {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .card-fileshare {
        grid-column: 1 / -1;
    }
}

/* File preview in modal */
.modal-file-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.modal-file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.file-preview-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: var(--bg);
}

.file-item-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.file-item-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.file-icon-large {
    font-size: 2.5rem;
    line-height: 1;
}

.file-item-info {
    flex: 1;
    min-width: 0;
}

.file-item-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.file-item-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.file-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .file-preview-image {
        max-height: 250px;
    }
    
    .file-icon-large {
        font-size: 2rem;
    }
    
    .file-item-header {
        gap: 0.75rem;
    }
}

/* Item more indicator */
.item-more {
    opacity: 0.7;
    font-style: italic;
}

.item-more:hover {
    opacity: 1;
    background: transparent;
    cursor: default;
}
