/* CSS Custom Properties */
:root {
    --primary-color: #1a83cc; /* Blue Grotto */
    --primary-dark: #00478f; /* Midnight Blue */
    --success-color: #10b981;
    --success-dark: #059669;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-primary: #00478f; /* Midnight Blue for primary text */
    --text-secondary: #1a83cc; /* Blue Grotto for secondary text */
    --text-light: #65dff6; /* Tiffany Blue for light text */
    --background: #ffffff;
    --surface: #f8fafc;
    --surface-elevated: #ffffff;
    --border: #cbebf5; /* Baby Blue for borders */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--surface) 0%, var(--background) 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* App Container */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0 1rem;
}

/* Authentication Section */
.auth-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.auth-container {
    background: var(--surface-elevated);
    border-radius: var(--radius-2xl);
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 400px;
    text-align: center;
    position: relative;
    transition: var(--transition-slow);
}

/* Login Container - Blue Theme */
.login-container {
    background: linear-gradient(135deg, var(--surface-elevated) 0%, #f0f8ff 100%);
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(26, 131, 204, 0.1);
}

.login-container .auth-title {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-container .auth-btn {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.login-container .auth-btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Signup Container - Green Theme */
.signup-container {
    background: linear-gradient(135deg, #f0fdf4 0%, var(--surface-elevated) 100%);
    border: 2px solid var(--success-color);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(16, 185, 129, 0.1);
    max-width: 450px;
}

.signup-container .auth-title {
    background: linear-gradient(135deg, var(--success-color) 0%, var(--success-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.signup-container .auth-btn {
    background: var(--success-color);
    border-color: var(--success-color);
}

.signup-container .auth-btn:hover {
    background: var(--success-dark);
    border-color: var(--success-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.signup-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--success-color), #34d399, var(--success-color));
    border-radius: var(--radius-2xl);
    z-index: -1;
    opacity: 0.1;
}

.auth-header {
    margin-bottom: 2rem;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

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

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

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(26 131 204 / 0.1);
}

.signup-container .form-group input:focus {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgb(16 185 129 / 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.auth-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
}

.auth-footer {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.auth-footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    transition: var(--transition);
}

.signup-container .link-btn {
    color: var(--success-color);
}

.link-btn:hover {
    color: var(--primary-dark);
    transform: translateY(-1px);
}

.signup-container .link-btn:hover {
    color: var(--success-dark);
}

/* Auth Loading State */
.auth-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-2xl);
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.signup-container .loading-spinner {
    border-top-color: var(--success-color);
}

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

.auth-loading p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* App Section */
.app-section {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.header-content {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition);
    background: var(--surface);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.back-link:hover {
    color: var(--text-primary);
    background: var(--surface-elevated);
    box-shadow: var(--shadow-md);
    transform: translateX(-2px);
}

.header-main {
    flex: 1;
    text-align: center;
}

.app-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.user-greeting {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
}

.logout-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Main Content */
.app-main {
    flex: 1;
    padding: 0 0 2rem 0;
}

.task-workspace {
    width: 100%;
    margin: 0 auto;
}

/* Workspace Layout */
.workspace-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* Main Task Area - Left Column */
.main-task-area {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.main-task-area .task-section {
    padding: 2.5rem;
    margin-bottom: 0;
}

.main-task-area .section-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.main-task-area .section-header p {
    font-size: 1.125rem;
}

/* Completed Tasks Sidebar - Right Column */
.completed-tasks-sidebar {
    position: sticky;
    top: 2rem;
}

.completed-tasks-sidebar .task-section {
    padding: 1.5rem;
    margin-bottom: 0;
}

.completed-tasks-sidebar .section-header h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.completed-tasks-sidebar .section-header p {
    font-size: 0.875rem;
}

/* Task Sections */
.task-section {
    background: var(--surface-elevated);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.task-section:hover {
    box-shadow: var(--shadow-lg);
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header-content {
    text-align: center;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Stats Container */
.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Task Form */
.task-form {
    margin-top: 1.5rem;
}

.input-group {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

#task-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--background);
    color: var(--text-primary);
}

#task-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(26 131 204 / 0.1);
}

#task-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

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

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgb(26 131 204 / 0.1);
}

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

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

.btn-secondary {
    background: var(--surface);
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--surface-elevated);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

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

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

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

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Current Task Display */
.current-task-display {
    text-align: center;
    padding: 2rem 0;
}

.task-content {
    margin-bottom: 2rem;
}

.current-task-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.4;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.task-timer {
    margin-bottom: 2rem;
}

.timer-display {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.timer-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.task-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Completed Tasks */
.completed-tasks-container {
    max-height: 400px;
    overflow-y: auto;
}

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

.completed-task-list li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.completed-task-list li:hover {
    background: var(--surface-elevated);
    box-shadow: var(--shadow-sm);
}

.completed-task-list li span:first-child {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.4;
}

.task-date {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    margin-left: 1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.875rem;
    line-height: 1.5;
}

.download-btn {
    width: 100%;
    margin-top: 1rem;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.app-footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.app-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: var(--radius-sm);
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(100%);
    transition: var(--transition-slow);
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.notification.show {
    transform: translateX(0);
}

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

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

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        padding: 0 0.5rem;
    }
    
    .workspace-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .main-task-area .task-section {
        padding: 1.5rem;
    }
    
    .main-task-area .section-header h2 {
        font-size: 1.5rem;
    }
    
    .main-task-area .section-header p {
        font-size: 1rem;
    }
    
    .completed-tasks-sidebar {
        position: static;
    }
    
    .completed-tasks-sidebar .task-section {
        padding: 1.5rem;
    }
    
    .completed-tasks-sidebar .section-header h2 {
        font-size: 1.25rem;
    }
    
    .completed-tasks-sidebar .section-header p {
        font-size: 0.875rem;
    }
    
    .task-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
    }
    
    .task-actions {
        flex-direction: column;
    }
    
    .completed-task-list li {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .task-date {
        margin-left: 0;
        align-self: flex-end;
    }
    
    .back-link {
        position: static;
        transform: none;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .user-section {
        order: -1;
    }
    
    .auth-container {
        padding: 2rem;
        margin: 1rem;
    }
    
    .signup-container {
        max-width: 400px;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 1.5rem 0;
    }
    
    .task-section {
        padding: 1rem;
    }
    
    .current-task-text {
        font-size: 1.25rem;
        padding: 1rem;
    }
    
    .timer-display {
        font-size: 2rem;
    }
    
    .auth-container {
        padding: 1.5rem;
    }
    
    .auth-title {
        font-size: 1.75rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #0f172a;
        --surface: #1e293b;
        --surface-elevated: #334155;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --border: #475569;
    }
} 