/* Place this file in: wins-tracker/css/styles.css */

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

:root {
    --primary-color: #007AFF;
    --secondary-color: #5856D6;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --error-color: #FF3B30;
    --background-color: #F2F2F7;
    --surface-color: #FFFFFF;
    --text-primary: #000000;
    --text-secondary: #8E8E93;
    --border-color: #C6C6C8;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Dark mode variables */
[data-theme="dark"] {
    --background-color: #000000;
    --surface-color: #1C1C1E;
    --text-primary: #FFFFFF;
    --text-secondary: #8E8E93;
    --border-color: #38383A;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body {
    font-family: var(--font-system);
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--surface-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-image {
    height: 40px;
    width: auto;
    max-width: 200px;
}

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

.user-email {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Theme Toggle */
.theme-toggle {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    width: 40px;
    height: 22px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-primary);
    top: 1px;
    left: 1px;
    transition: transform 0.3s ease;
}

[data-theme="dark"] .theme-toggle::before {
    transform: translateX(18px);
}

/* Tags */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    margin: 0.2rem;
    gap: 0.25rem;
}

.tag-input-container {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-height: 44px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.5rem;
    background: var(--surface-color);
    transition: border-color 0.2s ease;
}

.tag-input-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.tag-input {
    border: none;
    outline: none;
    background: transparent;
    padding: 0.25rem;
    font-family: var(--font-system);
    font-size: 1rem;
    color: var(--text-primary);
    flex: 1;
    min-width: 120px;
}

.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.tag-suggestions.show {
    display: block;
}

.tag-suggestion {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.tag-suggestion:hover,
.tag-suggestion.active {
    background-color: var(--background-color);
}

.tag-suggestion:last-child {
    border-bottom: none;
}

.tag-color-preview {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tag-remove {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    transition: background-color 0.2s ease;
}

.tag-remove:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Date Input Enhancement */
.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.date-quick-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.date-quick-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--surface-color);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

/* Streak Display */
.streak-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--success-color), #28A745);
    color: white;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.streak-flame {
    font-size: 1.5rem;
    animation: flicker 2s infinite alternate;
}

@keyframes flicker {
    0% { opacity: 1; }
    100% { opacity: 0.8; }
}

.streak-info {
    flex: 1;
}

.streak-number {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.streak-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.streak-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.streak-stat {
    text-align: center;
    padding: 1rem;
    background: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.streak-stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.streak-stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Enhanced Win Form */
.win-form-enhanced {
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: end;
}

.form-field {
    flex: 1;
}

.form-field-auto {
    flex: none;
}

/* Settings Page */
.settings-section {
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.settings-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.setting-info {
    flex: 1;
}

.setting-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.setting-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Time Input */
.time-input {
    width: 120px;
}

/* Day Selector */
.day-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.day-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    background: var(--surface-color);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

/* Tag Suggestions Display */
.tag-suggestions-display {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--background-color);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.tag-suggestion-section {
    margin-bottom: 1.5rem;
}

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

.tag-suggestion-section h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-clickable {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: none;
}

.tag-clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tag-clickable:active {
    transform: translateY(0);
}

.tag-usage-count {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    margin-left: 0.3rem;
}

/* Tag Management */
.tags-management-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.tag-management-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

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

.tag-management-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.tag-management-preview {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
}

.tag-management-details {
    flex: 1;
}

.tag-management-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.tag-management-stats {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

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

.btn-edit, .btn-delete {
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

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

.btn-delete:hover {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

/* Tag Edit Modal */
.tag-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.tag-edit-modal.show {
    display: flex;
}

.tag-edit-content {
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
}

.tag-edit-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.color-picker-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: var(--text-primary);
    transform: scale(1.2);
}

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

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

.empty-state-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state-description {
    font-size: 0.9rem;
}

/* Reports Styles */
.tag-summary-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tag-summary-item {
    padding: 1rem;
    background: var(--background-color);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.tag-summary-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.tag-summary-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.tag-count {
    font-weight: 600;
    color: var(--text-primary);
}

.tag-percentage {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tag-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.tag-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Edit Win Modal - Enhanced */
.edit-win-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.edit-win-modal.show {
    display: flex;
}

.edit-win-content {
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

/* Enhanced edit win modal for full editing */
.edit-win-modal .form-group {
    margin-bottom: 1.5rem;
}

.edit-win-modal .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.edit-win-modal .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-family: var(--font-system);
    font-size: 1rem;
    transition: border-color 0.2s ease;
    min-height: 44px;
}

.edit-win-modal .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Edit tag suggestions for modal */
#editTagSuggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

#editTagSuggestions.show {
    display: block;
}

#editTagSuggestions .tag-suggestion {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

#editTagSuggestions .tag-suggestion:hover,
#editTagSuggestions .tag-suggestion.active {
    background-color: var(--background-color);
}

#editTagSuggestions .tag-suggestion:last-child {
    border-bottom: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-system);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 44px;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-1px);
}

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

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

.btn-primary:hover {
    background: #0056CC;
}

.btn-success {
    background: var(--success-color);
    color: white;
    font-size: 1.2rem;
    padding: 1rem 2rem;
}

.btn-success:hover {
    background: #28A745;
}

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

.btn-secondary:hover {
    background: #6C6C70;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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

/* Cards */
.card {
    background: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

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

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-family: var(--font-system);
    font-size: 1rem;
    transition: border-color 0.2s ease;
    min-height: 44px;
    background: var(--surface-color);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.form-control.error {
    border-color: var(--error-color);
}

/* Auth pages */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-card {
    background: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    width: 100%;
    max-width: 900px; /* Increased from 500px for better use of screen real estate */
}

.auth-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.auth-form {
    margin-bottom: 1.5rem;
    max-width: 400px; /* Constrain form width while allowing marketing content to expand */
    margin-left: auto;
    margin-right: auto;
}

.auth-switch {
    text-align: center;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Marketing sections */
.feature-section {
    display: flex;
    align-items: center;
    gap: 3rem; /* Increased gap for larger screens */
    margin-bottom: 4rem; /* Increased margin for better spacing */
    flex-wrap: wrap;
}

.feature-content {
    flex: 1;
    min-width: 300px; /* Slightly larger minimum */
}

.feature-visual {
    flex: 1;
    min-width: 300px; /* Slightly larger minimum */
    text-align: center;
}

.feature-card {
    padding: 2.5rem; /* Increased padding for larger screens */
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
    max-width: 400px; /* Prevent cards from getting too wide */
    margin: 0 auto;
}

.feature-card:hover {
    transform: translateY(-2px);
}

.gradient-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.stats-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.dark-card {
    background: linear-gradient(135deg, #1C1C1E, #2C2C2E);
    color: white;
}

.cta-section {
    text-align: center;
    margin-top: 4rem; /* Increased margin */
    padding: 3rem 2rem; /* Increased padding */
    background: linear-gradient(135deg, rgba(0,122,255,0.1), rgba(88,86,214,0.1));
    border-radius: 12px;
    border: 1px solid rgba(0,122,255,0.2);
}

.tag-demo {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0;
}

.tag-demo .tag {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
}

/* Large screen optimizations */
@media (min-width: 1200px) {
    .auth-card {
        max-width: 1100px; /* Even wider on very large screens */
        padding: 3rem;
    }
    
    .feature-section {
        gap: 4rem;
        margin-bottom: 5rem;
    }
    
    .feature-card {
        padding: 3rem;
    }
    
    .cta-section {
        padding: 4rem 3rem;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .auth-card {
        max-width: 900px;
        padding: 2.5rem;
    }
    
    .feature-section {
        gap: 3rem;
    }
}

/* Dashboard */
.dashboard {
    padding: 2rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.add-win-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
}

.add-win-input {
    flex: 1;
    min-width: 200px;
}

/* Chart container */
.chart-container {
    position: relative;
    height: 400px;
    margin: 1.5rem 0;
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 1rem;
}

.chart-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.date-range {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Table */
.table-responsive {
    overflow-x: auto;
    margin-top: 1.5rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--background-color);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.table tbody tr:hover {
    background: var(--background-color);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(52, 199, 89, 0.2);
}

.alert-error {
    background: rgba(255, 59, 48, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(255, 59, 48, 0.2);
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Multiple wins 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);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.win-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.win-item input {
    flex: 1;
}

.remove-win {
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .add-win-form {
        flex-direction: column;
    }
    
    .add-win-input {
        min-width: auto;
    }
    
    .chart-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-range {
        justify-content: center;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    
    .auth-container {
        padding: 1rem;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    /* Marketing responsive */
    .feature-section {
        flex-direction: column;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .feature-content, .feature-visual {
        min-width: auto;
        flex: none;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .cta-section {
        padding: 1.5rem;
        margin-top: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    .logo-image {
        height: 30px;
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .logo-image {
        height: 25px;
        max-width: 120px;
    }
    
    .day-selector {
        justify-content: center;
    }
    
    .day-btn {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }
}
/* Make logo bigger on dashboard/app pages */
.header .logo-image {
    height: 70px;
    width: auto;
    max-width: 250px;
}

/* Even bigger on larger screens */
@media (min-width: 768px) {
    .header .logo-image {
        height: 80px;
        max-width: 300px;
    }
}

@media (min-width: 1200px) {
    .header .logo-image {
        height: 65px;
        max-width: 350px;
    }
}

/* Keep auth page logo size as is */
.auth-card .logo-image {
    height: 60px !important;
    max-width: 300px !important;
}

/* Make logo bigger on dashboard/app pages */
.header .logo-image {
    height: 50px;
    width: auto;
    max-width: 200px;
}

/* Responsive logo sizing */
@media (min-width: 768px) {
    .header .logo-image {
        height: 60px;
        max-width: 250px;
    }
}

@media (min-width: 1024px) {
    .header .logo-image {
        height: 70px;
        max-width: 300px;
    }
}

@media (min-width: 1200px) {
    .header .logo-image {
        height: 80px;
        max-width: 350px;
    }
}

/* Mobile-specific logo sizing - FIXED */
@media (max-width: 767px) {
    .header .logo-image {
        height: 35px !important;
        max-width: 150px !important;
    }
}

@media (max-width: 480px) {
    .header .logo-image {
        height: 30px !important;
        max-width: 120px !important;
    }
}

/* Keep auth page logo size as is */
.auth-card .logo-image {
    height: 60px !important;
    max-width: 300px !important;
}

/* ========== TASK MANAGEMENT STYLES ========== */

/* Task Page Layout */
.tasks-page {
    padding: 2rem 0;
}

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

.page-header h1 {
    margin-bottom: 0.5rem;
}

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

/* Main Navigation */
.main-nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: var(--radius);
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--background-color);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

/* Task Actions */
.task-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

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

/* Tasks Container */
.tasks-container {
    margin-bottom: 2rem;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Task Item */
.task-item {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    transition: all 0.2s ease;
    position: relative;
}

.task-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.task-item.drag-over {
    border-color: var(--primary-color);
    background: rgba(0, 122, 255, 0.05);
}

.task-item.completed-animation {
    animation: taskComplete 0.5s ease;
}

@keyframes taskComplete {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); background: var(--success-color); }
    100% { transform: scale(1); }
}

/* Task Drag Handle */
.task-drag-handle {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    cursor: grab;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.task-item:hover .task-drag-handle,
.subtask-item:hover .task-drag-handle {
    opacity: 1;
}

.task-drag-handle:active {
    cursor: grabbing;
}

/* Task Content */
.task-content {
    padding-left: 2rem;
}

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

.task-checkbox {
    flex-shrink: 0;
    padding-top: 0.25rem;
}

.task-complete-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--success-color);
}

.task-main {
    flex: 1;
    min-width: 0;
}

.task-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.task-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    word-break: break-word;
}

.task-title.completed {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.task-recurring-badge {
    font-size: 1rem;
    opacity: 0.7;
}

.subtask-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--background-color);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

.task-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0.5rem 0;
    line-height: 1.5;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-top: 0.75rem;
}

.task-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.task-date.overdue {
    color: var(--error-color);
    font-weight: 600;
}

.overdue-label {
    font-size: 0.8rem;
}

.task-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* Task Actions Buttons */
.task-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-icon {
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

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

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

.add-subtask-btn:hover {
}

.edit-task-btn:hover {
    background: rgba(0, 122, 255, 0.1);
}

.delete-task-btn:hover {
    background: rgba(255, 59, 48, 0.1);
}

.toggle-subtasks-btn:hover {
    background: var(--background-color);
}

/* Subtasks Container */
.subtasks-container {
    margin-top: 1rem;
    padding-left: 2rem;
    border-left: 3px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.subtask-item {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    transition: all 0.2s ease;
    position: relative;
}

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

.subtask-item.drag-over {
    border-color: var(--primary-color);
    background: rgba(0, 122, 255, 0.05);
}

.subtask-content {
    flex: 1;
    min-width: 0;
}

.subtask-title {
    font-size: 1rem;
    font-weight: 500;
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.subtask-title.completed {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

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

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Completed Tasks Section */
.completed-tasks-section {
    margin-top: 3rem;
}

.completed-tasks-section .task-item {
    opacity: 0.8;
}

.completed-tasks-section .task-item:hover {
    opacity: 1;
}

/* Task Modal */
.modal-large {
    max-width: 600px;
}

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

/* Selected Tags in Modal */
.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.selected-tag {
    position: relative;
    padding-right: 2rem;
}

.remove-tag {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 14px;
    line-height: 1;
    transition: background 0.2s ease;
}

.remove-tag:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* Recurrence Options */
.recurrence-options {
    padding: 1rem;
    background: var(--background-color);
    border-radius: var(--radius);
    margin-top: 1rem;
}

#customRecurrenceOptions {
    padding: 1rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-top: 1rem;
}

/* Tag Color Dot */
.tag-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Notification System */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

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

.notification.success {
    border-left: 4px solid var(--success-color);
}

.notification.error {
    border-left: 4px solid var(--error-color);
}

.notification.info {
    border-left: 4px solid var(--primary-color);
}

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

.notification-message {
    flex: 1;
    color: var(--text-primary);
}

.notification-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-secondary);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Progress Indicator */
.progress-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Responsive Task Styles */
@media (max-width: 768px) {
    .main-nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .task-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .task-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .task-content {
        padding-left: 1rem;
    }
    
    .subtasks-container {
        padding-left: 1rem;
    }
    
    .task-title {
        font-size: 1rem;
    }
    
    .btn-large {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
    
    .notification {
        min-width: auto;
        left: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .task-actions {
        flex-direction: column;
    }
    
    .btn-large {
        width: 100%;
    }
    
    .task-drag-handle {
        display: none;
    }
    
    .task-content {
        padding-left: 0;
    }
    
    .subtasks-container {
        padding-left: 0.5rem;
        border-left-width: 2px;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* Dark Mode Adjustments for Tasks */
[data-theme="dark"] .task-item {
    background: var(--surface-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .subtask-item {
    background: #2C2C2E;
    border-color: var(--border-color);
}

[data-theme="dark"] .task-drag-handle {
    color: var(--text-secondary);
}

[data-theme="dark"] .recurrence-options {
    background: #2C2C2E;
}

[data-theme="dark"] #customRecurrenceOptions {
    background: var(--surface-color);
}

/* Accessibility Improvements */
.task-complete-checkbox:focus,
.btn-icon:focus,
.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles for Tasks */
@media print {
    .task-drag-handle,
    .task-actions,
    .add-subtask-btn,
    .edit-task-btn,
    .delete-task-btn,
    .toggle-subtasks-btn,
    .btn,
    .main-nav,
    .header {
        display: none !important;
    }
    
    .task-item,
    .subtask-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .tasks-container {
        margin: 0;
    }
}