/* 
 * Main Styles for Decision Detox Website
 * Compatible with PHP version 8.3.15
 * Enhanced for better performance and maintainability
 */

:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --secondary-color: #2c3e50;
    --secondary-dark: #1a252f;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #ddd;
    --success-color: #2ecc71;
    --error-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f7fa;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-dark);
}

/* Header */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    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(--secondary-color);
}

.logo span {
    color: var(--primary-color);
}

/* Navigation */
nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 1.5rem;
}

nav ul li a {
    color: var(--dark-color);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

nav ul li a:hover {
    color: var(--primary-color);
}

nav ul li a.active {
    color: var(--primary-color);
}

nav ul li a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    padding: 0.75rem 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

.breadcrumb-nav a {
    color: var(--text-light);
}

.breadcrumb-nav a:hover {
    color: var(--primary-color);
}

.breadcrumb-nav .separator {
    margin: 0 0.5rem;
}

.breadcrumb-nav .current {
    color: var(--primary-color);
    font-weight: 500;
}

/* Hero Section */
.hero {
    background-color: var(--primary-color);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
}

.hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Content Sections */
.content-section {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.section-header h2 {
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--text-light);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    padding: 2rem;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.feature-link {
    display: inline-block;
    font-weight: 500;
    color: var(--primary-color);
}

.feature-link:hover {
    color: var(--primary-dark);
}

/* About Section */
.about-section {
    background-color: #f9f9f9;
    padding: 4rem 0;
}

.about-content {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    align-items: center;
}

.about-text {
    flex: 1;
    min-width: 300px;
}

.about-image {
    flex: 1;
    min-width: 300px;
    background-color: var(--primary-color);
    color: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: white;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
    color: white;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Forms */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.form-check input[type="checkbox"] {
    width: auto;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #e6f7e6;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}

.alert-error {
    background-color: #fdecea;
    color: #c62828;
    border-left: 4px solid #c62828;
}

.alert-warning {
    background-color: #fff8e1;
    color: #f57f17;
    border-left: 4px solid #f57f17;
}

.alert-info {
    background-color: #e3f2fd;
    color: #0277bd;
    border-left: 4px solid #0277bd;
}

/* Progress Indicators */
.step-indicators {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.step-indicator:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background-color: var(--border-color);
    z-index: 1;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 0.5rem;
    z-index: 2;
}

.step-indicator.active .step-circle {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.step-indicator.completed .step-circle {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.step-label {
    font-size: 0.85rem;
    text-align: center;
    color: var(--text-light);
}

.step-indicator.active .step-label {
    color: var(--primary-color);
    font-weight: 500;
}

.progress-container {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    margin: 1rem 0;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s;
}

/* Accessibility */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background-color: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 1000;
    transition: top 0.3s;
}

.skip-to-content:focus {
    top: 0;
}

.keyboard-focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
}

.mobile-menu-toggle span {
    height: 3px;
    width: 100%;
    background-color: var(--dark-color);
    border-radius: 3px;
    transition: all 0.3s;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-menu-overlay.open {
    display: block;
    opacity: 1;
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    color: white;
    padding: 2rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Enhanced Responsive Design */
@media (max-width: 992px) {
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .content-section {
        padding: 3rem 0;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: row;
        padding: 1rem 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    nav ul {
        position: fixed;
        top: 0;
        right: -300px;
        width: 280px;
        height: 100vh;
        background-color: white;
        flex-direction: column;
        padding: 2rem 1rem;
        margin: 0;
        z-index: 100;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s;
        overflow-y: auto;
    }
    
    nav ul.open {
        right: 0;
    }
    
    nav ul li {
        margin: 0 0 1rem 0;
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .about-content {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .step-indicators {
        flex-direction: column;
        gap: 1rem;
    }
    
    .step-indicator {
        flex-direction: row;
        justify-content: flex-start;
        gap: 1rem;
    }
    
    .step-indicator:not(:last-child)::after {
        display: none;
    }
    
    .step-circle {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    h3 {
        font-size: 1.4rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .content-section {
        padding: 2rem 0;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .form-container {
        padding: 1.5rem;
    }
}

/* Print Styles */
@media print {
    header, footer, .hero-buttons, .form-actions, .mobile-menu-toggle, .mobile-menu-overlay {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        background: white;
        color: black;
    }
    
    .container {
        width: 100%;
        max-width: none;
        padding: 0;
        margin: 0;
    }
    
    h1 {
        font-size: 18pt;
    }
    
    h2 {
        font-size: 16pt;
    }
    
    h3 {
        font-size: 14pt;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .feature-card, .form-container, .about-content {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .step-indicators, .progress-container {
        display: none;
    }
}

/* Dashboard Card Header Colors - Matches Tool Colors */
.dashboard-card.bias-toolkit .dashboard-card-header {
    background-color: #3498db; /* Blue for Bias Toolkit */
}

.dashboard-card.distortion-guide .dashboard-card-header {
    background-color: #2c3e50; /* Dark Blue/Navy for Distortion Guide */
}

.dashboard-card.framework .dashboard-card-header {
    background-color: #ff0000; /* Bright Red for Framework */
}

.dashboard-card.journal .dashboard-card-header {
    background-color: #9b59b6; /* Purple for Journal */
}

.dashboard-card.habit-tracker .dashboard-card-header {
    background-color: #f39c12; /* Orange for Habit Tracker */
}

/* Ensure text is readable on all background colors */
.dashboard-card-header h3 {
    color: white;
    margin: 0;
    padding: 0;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* Status Message */
.status-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--dark-color);
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

/* Autocomplete */
.autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 10;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}

.autocomplete-item:hover {
    background-color: #f5f5f5;
}

.autocomplete-item:last-child {
    border-bottom: none;
}
