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

:root {
    --primary-color: #4a90e2;
    --secondary-color: #50c878;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --physical-color: #e74c3c;
    --emotional-color: #50c878;
    --intellectual-color: #4a90e2;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #e1e8ed;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Card */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card h2 {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input[type="date"] {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
    margin-top: 10px;
}

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

.btn-primary:hover {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3);
}

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

.btn-secondary:hover {
    background: #3da662;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(80, 200, 120, 0.3);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Error Message */
.error-message {
    background: #fee;
    border: 2px solid var(--danger-color);
    color: var(--danger-color);
    padding: 12px;
    border-radius: 8px;
    margin-top: 20px;
    font-weight: 500;
}

/* Results */
.results-info {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.results-info p {
    margin-bottom: 10px;
    font-size: 1rem;
}

.biorhythm-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.biorhythm-card {
    padding: 20px;
    border-radius: 12px;
    border: 3px solid;
    background: white;
}

.biorhythm-card.physical {
    border-color: var(--physical-color);
}

.biorhythm-card.emotional {
    border-color: var(--emotional-color);
}

.biorhythm-card.intellectual {
    border-color: var(--intellectual-color);
}

.biorhythm-card h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.cycle-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 30px;
    background: var(--bg-color);
    border-radius: 15px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 15px;
}

.physical-fill {
    background: linear-gradient(90deg, var(--physical-color), #ff6b6b);
}

.emotional-fill {
    background: linear-gradient(90deg, var(--emotional-color), #5eead4);
}

.intellectual-fill {
    background: linear-gradient(90deg, var(--intellectual-color), #60a5fa);
}

.biorhythm-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.percent {
    font-size: 1.5rem;
    font-weight: bold;
}

.status {
    padding: 5px 12px;
    background: var(--bg-color);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Chart */
.chart-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.period-select {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 400px;
    margin-bottom: 20px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 30px;
    height: 4px;
    border-radius: 2px;
}

.physical-color {
    background: var(--physical-color);
}

.emotional-color {
    background: var(--emotional-color);
}

.intellectual-color {
    background: var(--intellectual-color);
}

/* Info Section */
.info-content p {
    margin-bottom: 15px;
}

.info-content hr {
    margin: 20px 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

/* Footer */
footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    padding: 20px;
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 20px;
    }

    .biorhythm-cards {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 300px;
    }

    .btn {
        width: 100%;
        margin-right: 0;
    }
}
