/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #7868E6;
    --secondary-color: #B8B5FF;
    --accent-color: #FFB4B4;
    --background-light: #EDEEF7;
    --background-white: #E4FBFF;
    --text-dark: #2d3748;
    --text-light: #718096;
    --success: #48bb78;
    --warning: #ed8936;
    --error: #f56565;
    --border-radius: 12px;
    --shadow: 0 4px 20px rgba(120, 104, 230, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--background-light) 0%, var(--background-white) 100%);
    min-height: 100vh;
    position: relative;
}

/* Paper texture effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(120, 104, 230, 0.1) 1px, transparent 0);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
}

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

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(120, 104, 230, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 2rem;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(120, 104, 230, 0.1);
}

/* Main Content */
.main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Welcome Card */
.welcome-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(120, 104, 230, 0.1);
}

.welcome-card h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.welcome-card p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 10px rgba(120, 104, 230, 0.05);
    border: 1px solid rgba(120, 104, 230, 0.1);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(120, 104, 230, 0.15);
}

.stat-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-color);
    border-radius: 50%;
}

.stat-info h3 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.stat-info p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Form Styles */
.setup-form {
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(120, 104, 230, 0.1);
}

.setup-form h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(120, 104, 230, 0.2);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.9);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(120, 104, 230, 0.1);
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

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

.btn-primary:hover {
    background: #6952d6;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(120, 104, 230, 0.3);
}

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

.btn-secondary:hover {
    background: #a8a4f5;
    transform: translateY(-2px);
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.btn-icon:hover {
    background: rgba(120, 104, 230, 0.1);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-icon {
    font-size: 1.2rem;
}

/* Calendar Styles */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.calendar-legend {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.legend-color.period {
    background: var(--accent-color);
}

.legend-color.fertile {
    background: var(--success);
}

.legend-color.ovulation {
    background: var(--warning);
}

.legend-color.today {
    background: var(--primary-color);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: rgba(120, 104, 230, 0.1);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.calendar-header-cell {
    background: var(--primary-color);
    color: white;
    padding: 0.8rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.calendar-cell {
    background: rgba(255, 255, 255, 0.9);
    padding: 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    min-height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.calendar-cell:hover {
    background: rgba(120, 104, 230, 0.1);
}

.calendar-cell.other-month {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.5);
}

.calendar-cell.today {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.calendar-cell.period {
    background: var(--accent-color);
    color: white;
}

.calendar-cell.fertile {
    background: var(--success);
    color: white;
}

.calendar-cell.ovulation {
    background: var(--warning);
    color: white;
}

.calendar-cell.marked::after {
    content: '•';
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 1.5rem;
}

.calendar-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Predictions Styles */
.predictions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.prediction-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(120, 104, 230, 0.1);
}

.prediction-card h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.chart-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(120, 104, 230, 0.1);
}

.chart-container h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

#cycle-chart {
    width: 100%;
    max-width: 600px;
    height: 300px;
    margin: 0 auto;
    display: block;
}

/* Event and History Styles */
.event-item,
.history-item,
.stat-item {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    background: rgba(120, 104, 230, 0.05);
    border-left: 4px solid var(--primary-color);
}

.event-date,
.history-date {
    font-weight: 600;
    color: var(--primary-color);
}

.event-type,
.history-details {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* FAQ Styles */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(120, 104, 230, 0.1);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 1.5rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-dark);
    transition: var(--transition);
}

.faq-question:hover {
    background: rgba(120, 104, 230, 0.05);
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 200px;
    padding: 0 1.5rem 1.5rem;
}

.faq-answer p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(120, 104, 230, 0.1);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-light);
    backdrop-filter: blur(10px);
   margin-bottom: 60px;

}

/* Notification Styles */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.notification {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
    animation: slideIn 0.3s ease;
    backdrop-filter: blur(10px);
    max-width: 300px;
}

.notification.success {
    border-left-color: var(--success);
}

.notification.error {
    border-left-color: var(--error);
}

.notification.warning {
    border-left-color: var(--warning);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-list {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .welcome-card {
        padding: 1.5rem;
    }
    
    .welcome-card h2 {
        font-size: 1.5rem;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
    }
    
    .calendar-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
    }
    
    .calendar-header h2 {
        font-size: 1.3rem;
    }
    
    .calendar-controls h3 {
        font-size: 1.1rem;
    }
    
    .calendar-legend {
        gap: 0.8rem;
        justify-content: center;
        font-size: 0.85rem;
    }
    
    .legend-item {
        font-size: 0.8rem;
    }
    
    .legend-color {
        width: 16px;
        height: 16px;
    }
    
    .calendar-grid {
        gap: 0.5px;
    }
    
    .calendar-header-cell {
        padding: 0.5rem 0.3rem;
        font-size: 0.75rem;
    }
    
    .calendar-cell {
        min-height: 45px;
        padding: 0.4rem;
        font-size: 0.85rem;
    }
    
    .calendar-cell.marked::after {
        font-size: 1.2rem;
        bottom: 2px;
        right: 2px;
    }
    
    .predictions-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .calendar-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .calendar-actions .btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .main {
        padding: 1rem 0;
    }
    
    .welcome-card,
    .prediction-card,
    .chart-container {
        padding: 1rem;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .logo-icon {
        font-size: 1.4rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .calendar-header {
        padding: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .calendar-header h2 {
        font-size: 1.1rem;
    }
    
    .calendar-controls {
        gap: 0.5rem;
    }
    
    .calendar-controls h3 {
        font-size: 0.95rem;
    }
    
    .btn-icon {
        font-size: 1rem;
        padding: 0.3rem;
    }
    
    .calendar-legend {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .legend-item {
        font-size: 0.7rem;
    }
    
    .legend-color {
        width: 14px;
        height: 14px;
    }
    
    .calendar-grid {
        gap: 0;
        margin-bottom: 1rem;
    }
    
    .calendar-header-cell {
        padding: 0.4rem 0.2rem;
        font-size: 0.7rem;
        font-weight: 600;
    }
    
    .calendar-cell {
        min-height: 40px;
        padding: 0.2rem;
        font-size: 0.75rem;
    }
    
    .calendar-cell.marked::after {
        font-size: 1rem;
        bottom: 1px;
        right: 1px;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .prediction-card h3,
    .chart-container h3 {
        font-size: 1.1rem;
    }
    
    #notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .notification {
        max-width: 100%;
    }
}

/* Hidden class for dynamic content */
.hidden {
    display: none !important;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(120, 104, 230, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
button:focus,
input:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #5a4fcf;
        --secondary-color: #9b97e8;
        --text-dark: #000;
        --text-light: #333;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
