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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #10b981;
    --tertiary-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

/* Header */
.app-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.app-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.date-display {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.notification-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

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

/* Main Content */
main {
    padding: var(--spacing-lg) 0;
}

.productivity-form {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Sections */
section {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
}

section:last-child {
    border-bottom: none;
}

section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

section h2 i {
    color: var(--primary-color);
}

/* Message Section */
.message-section {
    background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
}

.input-group {
    margin-bottom: var(--spacing-md);
}

.input-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.input-group textarea {
    width: 100%;
    padding: var(--spacing-sm);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s ease;
}

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

/* Mindset Section */
.mindset-section {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
}

.mindset-questions {
    display: grid;
    gap: var(--spacing-md);
}

.question-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    line-height: 1.4;
}

.question-group textarea {
    width: 100%;
    padding: var(--spacing-sm);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.4;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.2s ease;
}

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

/* Goals Section */
.goals-section {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.goals-container {
    display: grid;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.goal-item {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    transition: all 0.2s ease;
}

.goal-item:hover {
    border-color: var(--secondary-color);
    box-shadow: var(--shadow-md);
}

.goal-item.completed {
    background: #f0fdf4;
    border-color: var(--secondary-color);
}

.goal-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.goal-number {
    background: var(--secondary-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.goal-input {
    flex: 1;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.goal-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.goal-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.goal-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.goal-actions label {
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Progress Bar */
.goals-progress {
    background: white;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: var(--spacing-xs);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), #059669);
    border-radius: 6px;
    transition: width 0.3s ease;
    width: 0%;
}

#progress-text {
    text-align: center;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

/* Action Buttons */
.actions-section {
    background: var(--bg-secondary);
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    text-decoration: none;
}

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

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

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

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

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

/* Stats Section */
.stats-section {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-md);
}

.stat-item {
    background: white;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
}

.stat-item:hover {
    border-color: var(--tertiary-color);
    box-shadow: var(--shadow-md);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--tertiary-color);
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: var(--spacing-xs);
}

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

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.close {
    color: var(--text-light);
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-md);
    cursor: pointer;
}

.close:hover {
    color: var(--text-primary);
}

.modal-content h3 {
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.modal-content h3 i {
    color: var(--primary-color);
}

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

.notification-settings label {
    font-weight: 500;
    color: var(--text-primary);
}

.notification-settings input[type="time"] {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
}

/* Success Message */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--secondary-color);
    color: white;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    gap: var(--spacing-xs);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .app-header .container {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }
    
    .app-header h1 {
        font-size: 1.5rem;
    }
    
    section {
        padding: var(--spacing-md);
    }
    
    .actions-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .goal-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-xs);
    }
    
    .modal-content {
        margin: 20% auto;
        width: 95%;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    section h2 {
        font-size: 1.25rem;
    }
    
    .goal-number {
        align-self: flex-start;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-light: #9ca3af;
        --bg-primary: #1f2937;
        --bg-secondary: #374151;
        --bg-tertiary: #4b5563;
        --border-color: #4b5563;
        --border-light: #374151;
    }
    
    body {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    }
    
    .productivity-form {
        background: var(--bg-primary);
    }
    
    .app-header {
        background: rgba(31, 41, 55, 0.95);
    }
    
    .message-section {
        background: linear-gradient(135deg, #451a03 0%, #78350f 100%);
    }
    
    .mindset-section {
        background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
    }
    
    .goals-section {
        background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    }
    
    .stats-section {
        background: linear-gradient(135deg, #451a03 0%, #78350f 100%);
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .app-header,
    .actions-section,
    .notification-btn,
    .modal {
        display: none !important;
    }
    
    .productivity-form {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    section {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}