:root {
    --primary-color: #d35d90;
    --primary-dark: #b34677;
    --background-light: #f5f5f5;
    --menstrual-color: #d35d90;
    --follicular-color: #5fb3ce;
    --ovulation-color: #f9d56e;
    --luteal-color: #eb9f82;
    --primary-text: #333;
    --secondary-text: #666;
    --background: #fff;
    --border-radius: 12px;
    --accent-color: #333;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--primary-text);
    background: var(--background);
}

.screen {
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hidden {
    display: none !important;
}

/* Welcome Screen */
.welcome-content {
    text-align: center;
    padding: 40px 20px;
    max-width: 600px;
    margin: auto;
}

.welcome-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--menstrual-color), var(--ovulation-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.primary-button {
    background: linear-gradient(45deg, var(--menstrual-color), var(--ovulation-color));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.primary-button:active {
    transform: scale(0.98);
}

.secondary-button {
    background: transparent;
    border: 2px solid var(--menstrual-color);
    color: var(--menstrual-color);
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
}

/* Cycle Setup Screen */
.cycle-length-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.cycle-length-control button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-color);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cycle-length-control button:hover {
    background-color: var(--primary-dark);
}

.cycle-length-control span {
    font-size: 1.2rem;
    font-weight: bold;
    min-width: 100px;
    text-align: center;
}

.cycle-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    padding: 1rem;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.cycle-grid .cycle-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--background-light);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    padding: 4px;
    margin: 0;
    text-align: center;
}

.cycle-grid .cycle-day .day-number,
.cycle-grid .cycle-day .day-title {
    color: white;
}

.cycle-grid .cycle-day .day-number {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 2px;
}

.cycle-grid .cycle-day .day-title {
    font-size: 0.7rem;
    line-height: 1;
    opacity: 0.9;
}

.cycle-grid .cycle-day:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cycle-grid .cycle-day.selected {
    border: 3px solid white;
    font-weight: bold;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.cycle-info {
    text-align: center;
    margin: 1.5rem 0;
    font-size: 1.2rem;
}

#selectedDay {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.4rem;
}

#cycleSetupScreen {
    padding: 2rem;
}

#cycleSetupScreen h2 {
    margin-bottom: 1rem;
    text-align: center;
}

#cycleSetupScreen p {
    text-align: center;
    color: var(--secondary-text);
    margin-bottom: 1rem;
}

.period-start-controls {
    max-width: 300px;
    margin: 2rem auto 1rem;
}

.period-date-input {
    margin-top: 1rem;
    text-align: center;
}

.period-date-input label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--secondary-text);
}

.date-select {
    display: flex;
    gap: 0.5rem;
}

.date-select select {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--secondary-text);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
}

.date-select select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.period-date-input input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--secondary-text);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

#periodStartedBtn {
    width: 100%;
}

#saveCycleBtn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 1rem auto;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: var(--border-radius);
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

#saveCycleBtn:hover {
    background: var(--primary-dark);
}

/* Main Screen */
header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
}

.overview-panel {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.phase-progress {
    width: 100%;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    margin: 15px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--menstrual-color), var(--ovulation-color));
    transition: width 0.3s ease;
}

/* Timeline */
.timeline-container {
    width: 100%;
    overflow-x: auto;
    padding: 20px 0;
    scroll-behavior: smooth;
}

.timeline {
    display: flex;
    gap: 10px;
    padding: 0 20px;
    min-width: min-content;
}

.day-card {
    flex: 0 0 auto;
    width: 80px;
    padding: 15px 10px;
    background: white;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: all 0.2s;
    cursor: pointer;
}

.day-card.current {
    transform: scale(1.05);
    border: 2px solid currentColor;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.day-card .day-number {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 5px 0;
}

.day-card .phase-emoji {
    font-size: 1.2rem;
}

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

.day-card.chosen {
    background: var(--primary-color);
    color: white;
}

.day-card.chosen:hover {
    transform: scale(1.1) translateY(-2px);
}

.timeline .day-card {
    min-width: 80px;
    padding: 8px;
    margin: 0 4px;
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
    color: var(--primary-text);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.timeline .day-card .day-title {
    font-size: 0.7rem;
    line-height: 1.2;
    opacity: 0.9;
    margin-top: 4px;
    font-weight: 500;
    color: var(--primary-text);
}

.timeline .day-card .emoji-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin: 4px 0;
}

.timeline .day-card .phase-emoji,
.timeline .day-card .day-emoji {
    font-size: 1rem;
    line-height: 1;
}

.timeline .day-card.selected {
    transform: scale(1.05);
    border: 2px solid var(--accent-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.timeline .day-card.current {
    transform: scale(1.05);
    border: 2px solid currentColor;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.timeline .day-card.current.selected {
    border: 2px solid var(--accent-color);
}

/* FAB Menu */
.floating-action-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.fab:hover {
    transform: scale(1.1);
}

.fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    min-width: 200px;
}

.fab-menu button {
    display: block;
    width: 100%;
    padding: 12px 20px;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--primary-text);
}

.fab-menu button:hover {
    background: #f5f5f5;
}

/* Overview Panel */
#overview-panel {
    position: fixed;
    right: 20px;
    top: 20px;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
    z-index: 100;
}

.overview-header {
    text-align: center;
    margin-bottom: 20px;
}

.day-emoji {
    font-size: 2em;
    display: block;
    margin-bottom: 10px;
}

.day-title {
    margin: 0;
    font-size: 1.5em;
    color: var(--primary-color);
}

.day-phase {
    display: block;
    color: var(--text-muted);
    font-size: 0.9em;
    margin-top: 5px;
}

.overview-mood {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
}

.mood-short {
    font-size: 1.2em;
    margin: 0 0 5px 0;
    color: var(--primary-color);
}

.mood-full {
    margin: 0;
    color: var(--text-muted);
}

.overview-details section {
    margin-bottom: 20px;
}

.overview-details h3 {
    font-size: 1em;
    color: var(--primary-color);
    margin: 0 0 8px 0;
}

.overview-details p {
    margin: 0;
    line-height: 1.5;
    color: var(--text-color);
}

.recommendation-short {
    font-weight: bold;
    margin-bottom: 8px !important;
}
