/* ============================================
   Goal Tracker & Habit Builder - Styles
   ============================================ */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #C62E2E;
    --secondary: #1e1e1e;
    --accent: #C1E172;
    --background: #f8f9fa;
    --text: #1e1e1e;
    --text-muted: #6c757d;
    --border: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--background);
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.logo:hover {
    opacity: 0.8;
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav a:hover {
    color: var(--primary);
}

.nav-cta {
    background: var(--primary);
    color: #fff !important;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
}

.nav-cta:hover {
    background: #a12424;
    color: #fff !important;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #a12424 100%);
    color: #fff;
    padding: 4rem 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-description {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.btn-primary {
    background: #fff;
    color: var(--primary);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Main Content */
.main-content {
    padding: 3rem 0;
}

.tool-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--secondary);
}

.section-title i {
    color: var(--primary);
}

/* Challenge Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.setting-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.setting-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
}

.setting-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.current-day-display {
    background: var(--accent);
    color: var(--secondary);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
}

.btn-navigate {
    width: 100%;
    padding: 0.75rem;
    background: var(--secondary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-navigate:hover {
    background: #333;
    transform: translateY(-2px);
}

/* Day Calendar */
.card-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--secondary);
}

.day-calendar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.day-cell {
    background: #f8f9fa;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.day-cell:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.day-cell.current {
    background: var(--accent);
    border-color: var(--accent);
    font-weight: 700;
}

.day-cell.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.day-number {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.day-cell.current .day-number,
.day-cell.active .day-number {
    color: inherit;
}

.day-count {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.controls button {
    flex: 1;
    min-width: 150px;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add {
    background: var(--primary);
    color: #fff;
}

.btn-add:hover {
    background: #a12424;
    transform: translateY(-2px);
}

.btn-export,
.btn-import {
    background: var(--secondary);
    color: #fff;
}

.btn-export:hover,
.btn-import:hover {
    background: #333;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* Goals Section */
.goals-section {
    margin-bottom: 2rem;
}

.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.goal-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.goal-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.goal-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary);
    flex: 1;
}

.goal-menu {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: var(--transition);
}

.goal-menu:hover {
    color: var(--primary);
}

.goal-target {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.progress-bar-container {
    background: #e9ecef;
    border-radius: 20px;
    height: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 20px;
    transition: width 0.5s ease;
}

.goal-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.goal-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.goal-btn {
    background: var(--secondary);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.goal-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.goal-count {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: var(--radius-sm);
}

.stat-item i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.stat-item .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.stat-item .stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.modal-header h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    padding: 0.5rem;
}

.modal-close:hover {
    color: var(--primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 2px solid var(--border);
    display: flex;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.color-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-option {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: var(--secondary);
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--secondary);
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Features Section */
.features {
    background: #fff;
    padding: 4rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: var(--radius);
    background: var(--background);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--secondary);
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.7;
}

/* How to Use Section */
.how-to-use {
    padding: 4rem 0;
    background: var(--background);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.step-card {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.step-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--secondary);
}

.step-card p {
    color: var(--text-muted);
    line-height: 1.7;
}

/* Content Section */
.content-section {
    background: #fff;
    padding: 4rem 0;
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.content-wrapper h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--secondary);
}

.content-wrapper h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--secondary);
}

.content-wrapper p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: var(--text);
}

/* CTA Section */
.cta-section {
    background: var(--background);
    padding: 4rem 0;
}

.cta-dual {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.cta-card {
    background: #fff;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.cta-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.cta-card h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--secondary);
}

.cta-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-cta-primary {
    background: var(--primary);
    color: #fff;
    padding: 1rem 2rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-cta-primary:hover {
    background: #a12424;
    transform: translateY(-2px);
}

.btn-cta-secondary {
    background: var(--secondary);
    color: #fff;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-cta-secondary:hover {
    background: #333;
    transform: translateY(-2px);
}

.cta-features {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.cta-features span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cta-features i {
    color: var(--accent);
}

/* FAQ Section */
.faq-section {
    background: #fff;
    padding: 4rem 0;
}

.faq-container {
    max-width: 800px;
    margin: 2rem auto 0;
}

.faq-item {
    margin-bottom: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background: #fff;
    border: none;
    padding: 1.25rem;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--background);
}

.faq-question i {
    transition: var(--transition);
    color: var(--primary);
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 1.25rem;
    background: var(--background);
    color: var(--text);
    line-height: 1.8;
}

/* Footer */
footer {
    background: var(--secondary);
    color: #fff;
    padding: 3rem 0 1.5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--accent);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--accent);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .day-calendar {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .goals-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-dual {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .controls button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .day-calendar {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }
    
    .day-cell {
        padding: 0.5rem;
    }
    
    .modal-content {
        width: 95%;
    }
}