:root {
    --aggk-primary-color: #0d9488; /* Teal */
    --aggk-secondary-color: #f0fdfa; /* Light Teal */
    --aggk-text-color: #1f2937; /* Dark Gray */
    --aggk-label-color: #4b5563; /* Medium Gray */
    --aggk-border-color: #d1d5db; /* Light Gray */
    --aggk-bg-color: #ffffff;
    --aggk-error-color: #dc2626; /* Red */
    --aggk-success-color: #16a34a; /* Green */
    --aggk-peak-color: #4ade80; /* Bright Green for peak day */
}

#aggkalkylator-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem;
    background: var(--aggk-bg-color);
    color: var(--aggk-text-color);
}

.aggk-header {
    text-align: center;
    margin-bottom: 2rem;
}

.aggk-header h2 {
    font-size: 2rem;
    color: var(--aggk-primary-color);
    margin-bottom: 0.5rem;
}

.aggk-header p {
    font-size: 1rem;
    color: var(--aggk-label-color);
}

.aggk-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.aggk-card {
    background: #f9fafb;
    border: 1px solid var(--aggk-border-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.aggk-card-title {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    color: var(--aggk-primary-color);
}

.aggk-card-description {
    font-size: 0.9rem;
    color: var(--aggk-label-color);
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.aggk-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.aggk-input-group label {
    font-weight: 500;
    color: var(--aggk-label-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.aggk-input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--aggk-border-color);
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}

.aggk-input-group input:focus {
    outline: none;
    border-color: var(--aggk-primary-color);
    box-shadow: 0 0 0 2px var(--aggk-secondary-color);
}

.aggk-tooltip {
    position: relative;
    cursor: help;
    display: inline-flex;
    align-items: center;
}

.aggk-tooltip svg {
    color: var(--aggk-label-color);
}

.aggk-tooltip .aggk-tooltip-text {
    visibility: hidden;
    width: 220px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -110px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    font-weight: 400;
}

.aggk-tooltip:hover .aggk-tooltip-text {
    visibility: visible;
    opacity: 1;
}

.aggk-button {
    background-color: var(--aggk-primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 1rem;
}

.aggk-button:hover {
    background-color: #0f766e;
}

/* Results */
.aggk-results-container {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--aggk-secondary-color);
}

.aggk-results-title {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: var(--aggk-primary-color);
}

.aggk-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.aggk-result-box {
    background-color: var(--aggk-secondary-color);
    border-left: 5px solid var(--aggk-primary-color);
    border-radius: 0 8px 8px 0;
    padding: 1rem;
}

.aggk-result-box.peak-day {
    background-color: #ecfdf5;
    border-left-color: var(--aggk-peak-color);
}

.aggk-result-box h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--aggk-text-color);
}

.aggk-result-box p {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--aggk-primary-color);
}

.aggk-result-box.peak-day p {
    color: #15803d;
}

.aggk-result-box span {
    font-size: 0.8rem;
    color: var(--aggk-label-color);
    display: block;
    margin-top: 0.5rem;
}

.aggk-error-message {
    color: var(--aggk-error-color);
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    margin-top: 1rem;
}

/* Timeline Chart */
.aggk-timeline-title {
    margin-top: 2.5rem;
    text-align: center;
    font-size: 1.25rem;
    color: var(--aggk-text-color);
}

.aggk-timeline-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--aggk-label-color);
}

.aggk-legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.aggk-timeline-chart {
    display: flex;
    overflow-x: auto;
    padding: 1rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--aggk-border-color) var(--aggk-secondary-color);
}
.aggk-timeline-chart::-webkit-scrollbar {
    height: 8px;
}
.aggk-timeline-chart::-webkit-scrollbar-track {
    background: var(--aggk-secondary-color);
}
.aggk-timeline-chart::-webkit-scrollbar-thumb {
    background-color: var(--aggk-border-color);
    border-radius: 10px;
}

.aggk-day {
    flex: 0 0 50px;
    height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #e5e7eb;
    text-align: center;
    font-size: 0.8rem;
    position: relative;
    background: #f9fafb;
}
.aggk-day:last-child {
    border-right: none;
}

.aggk-day-date {
    font-size: 1.2rem;
    font-weight: bold;
}
.aggk-day-weekday {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--aggk-label-color);
}

.aggk-day.period { background-color: #fecaca; }
.aggk-day.fertile { background-color: #a7f3d0; }
.aggk-day.ovulation {
    background-color: var(--aggk-peak-color);
    color: white;
    font-weight: bold;
}
.aggk-day.ovulation .aggk-day-weekday { color: #d1fae5; }
.aggk-day.luteal { background-color: #bfdbfe; }


@media (max-width: 600px) {
    .aggk-results-grid {
        grid-template-columns: 1fr;
    }
    
    .aggk-header h2 {
        font-size: 1.5rem;
    }
    .aggk-results-title {
        font-size: 1.5rem;
    }
    .aggk-day {
        flex: 0 0 45px;
        height: 65px;
    }
    .aggk-timeline-legend {
        gap: 1rem;
        justify-content: flex-start;
    }
}




