/* Selene - Privacy-First Lunar Tracker Stylesheet */
:root {
    --bg-app: #07030d;
    --bg-card: #12091d;
    --bg-card-hover: #1b0f2a;
    --border-color: #27163a;
    --sidebar-bg: #040108;
    
    --text-primary: #f5f2f7;
    --text-secondary: #a99bb8;
    --text-muted: #706080;
    
    --primary: #c38bbf;
    --primary-hover: #d7a4d3;
    --primary-light: rgba(195, 139, 191, 0.15);
    
    --fertile: #8bc34a;
    --fertile-light: rgba(139, 195, 74, 0.15);
    --ovulation: #4caf50;
    
    --danger: #ef5350;
    --danger-hover: #e57373;
    --gold: #dfb26c;
    --gold-light: rgba(223, 178, 108, 0.15);
    
    --font-sans: 'Outfit', sans-serif;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.brand-icon {
    font-size: 28px;
    filter: drop-shadow(0 0 10px rgba(195, 139, 191, 0.5));
}

.brand h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #f5f2f7 0%, #c38bbf 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    background: none;
    border: none;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--primary-light);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(195, 139, 191, 0.2);
    text-shadow: 0 0 10px rgba(195, 139, 191, 0.2);
}

.legal-badge {
    margin-top: auto;
    padding: 16px;
    background: rgba(255, 255, 255, 0.01);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.03);
    text-align: center;
}

.legal-badge p {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.legal-badge .small {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    padding: 48px 64px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.tab-header {
    margin-bottom: 40px;
}

.tab-header h2 {
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Cards & Layout */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(195, 139, 191, 0.25);
    box-shadow: 0 12px 48px 0 rgba(0, 0, 0, 0.6);
}

/* Setup Screen */
.setup-card {
    max-width: 550px;
    margin: 40px auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow);
}

.setup-card h2 {
    font-size: 28px;
    margin-bottom: 8px;
    text-align: center;
}

.setup-card .subtitle {
    text-align: center;
    margin-bottom: 32px;
}

.setup-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.help-text {
    font-size: 12px;
    color: var(--text-muted);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

/* Status Card with Cycle Ring */
.status-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 380px;
}

.cycle-ring-container {
    position: relative;
    width: 220px;
    height: 220px;
    margin-bottom: 24px;
}

.cycle-ring-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.02);
    stroke-width: 10px;
}

.ring-progress {
    fill: none;
    stroke: var(--primary);
    stroke-width: 10px;
    stroke-linecap: round;
    stroke-dasharray: 534; 
    stroke-dashoffset: 534;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.ring-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
    padding: 20px;
}

.ring-subtitle {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.ring-title {
    font-size: 52px;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    line-height: 1;
}

.ring-status {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    display: block;
    margin-top: 8px;
}

.action-buttons {
    width: 100%;
}

.btn-toggle-period {
    width: 100%;
    background-color: var(--primary-light);
    border: 1px dashed var(--primary);
    color: var(--primary);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    padding: 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.btn-toggle-period:hover {
    background-color: var(--primary);
    color: var(--bg-app);
    border-style: solid;
}

.btn-toggle-period.active {
    background-color: var(--primary);
    color: var(--bg-app);
    border-style: solid;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(195, 139, 191, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(195, 139, 191, 0); }
    100% { box-shadow: 0 0 0 0 rgba(195, 139, 191, 0); }
}

/* Moon Sync Widget in Dashboard */
.summary-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.moon-sync-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.moon-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--gold-light);
    border: 1px solid rgba(223, 178, 108, 0.2);
    padding: 6px 14px;
    border-radius: 30px;
}

.moon-emoji {
    font-size: 20px;
    filter: drop-shadow(0 0 8px rgba(223, 178, 108, 0.5));
}

.moon-phase-lbl {
    font-size: 14px;
    font-weight: 600;
    color: var(--gold);
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.01);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.timeline-icon {
    font-size: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-icon.period {
    background-color: rgba(239, 83, 80, 0.15);
}

.timeline-icon.fertile {
    background-color: var(--fertile-light);
}

.timeline-info h4 {
    font-size: 15px;
    font-weight: 600;
}

.timeline-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.phase-info-box {
    background: linear-gradient(135deg, rgba(195, 139, 191, 0.1) 0%, rgba(18, 9, 29, 0) 100%);
    border: 1px solid rgba(195, 139, 191, 0.15);
    border-radius: var(--radius-md);
    padding: 20px;
}

.phase-info-box h4 {
    font-size: 15px;
    margin-bottom: 6px;
    color: var(--primary);
}

.phase-info-box p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Daily Log Card */
.daily-log-card {
    margin-top: 32px;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.log-date {
    background-color: rgba(255, 255, 255, 0.03);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
}

.symptoms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.symptom-category h4 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.symptom-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.symptom-btn {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.symptom-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.symptom-btn.active {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.notes-section {
    margin-bottom: 24px;
}

.notes-section label {
    font-size: 14px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notes-section textarea {
    width: 100%;
    height: 90px;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    resize: none;
    outline: none;
    transition: var(--transition);
}

.notes-section textarea:focus {
    border-color: var(--primary);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--bg-app);
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: var(--text-secondary);
}

/* Calendar Card */
.calendar-card {
    max-width: 620px;
    margin: 0 auto;
}

.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-icon:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    position: relative;
    border: 1px solid transparent;
    transition: var(--transition);
    background-color: rgba(255, 255, 255, 0.01);
}

.calendar-day:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

.calendar-day.empty {
    cursor: default;
    pointer-events: none;
    background: none;
}

.calendar-day.today {
    border-color: var(--primary);
}

.calendar-day.selected {
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 1px var(--text-muted);
}

.day-num {
    z-index: 2;
}

.day-moon {
    font-size: 10px;
    position: absolute;
    top: 4px;
    right: 4px;
    color: var(--gold);
    opacity: 0.7;
}

/* Indicators */
.calendar-day.period-day {
    background-color: rgba(239, 83, 80, 0.2);
    color: #ef5350;
    font-weight: 700;
}

.calendar-day.predicted-period-day {
    background-color: rgba(239, 83, 80, 0.05);
    border: 1px dashed rgba(239, 83, 80, 0.4);
    color: rgba(239, 83, 80, 0.7);
}

.calendar-day.fertile-day {
    background-color: rgba(139, 195, 74, 0.12);
    color: #8bc34a;
}

.calendar-day.ovulation-day {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    font-weight: 700;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.3);
}

.calendar-day.has-notes::after {
    content: '';
    position: absolute;
    bottom: 6px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--primary);
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-top: 28px;
    font-size: 13px;
    color: var(--text-secondary);
}

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

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.color-dot.period { background-color: rgba(239, 83, 80, 0.2); border: 1.5px solid #ef5350; }
.color-dot.predicted-period { background-color: rgba(239, 83, 80, 0.05); border: 1.5px dashed rgba(239, 83, 80, 0.4); }
.color-dot.fertile { background-color: rgba(139, 195, 74, 0.12); border: 1.5px solid #8bc34a; }
.color-dot.ovulation { background-color: rgba(76, 175, 80, 0.2); border: 1.5px solid #4caf50; }

/* Analytics */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card-mini {
    text-align: center;
    padding: 24px;
}

.stat-val {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-lbl {
    font-size: 14px;
    color: var(--text-secondary);
}

.correlation-card {
    margin-bottom: 32px;
    background: linear-gradient(135deg, rgba(223, 178, 108, 0.08) 0%, rgba(18, 9, 29, 0) 100%);
    border-color: rgba(223, 178, 108, 0.2);
}

.correlation-card h3 {
    margin-bottom: 16px;
    color: var(--gold);
}

.moon-type-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.moon-type-desc {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 15px;
}

.prediction-history-card h3 {
    margin-bottom: 20px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.history-dates {
    font-weight: 600;
}

.history-duration {
    color: var(--text-secondary);
    font-size: 14px;
}

.empty-text {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Privacy Page */
.privacy-info-card {
    margin-bottom: 32px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.05) 0%, rgba(18, 9, 29, 0) 100%);
    border-color: rgba(76, 175, 80, 0.15);
}

.privacy-info-card h3 {
    color: #8bc34a;
    margin-bottom: 16px;
}

.privacy-info-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.privacy-info-card li {
    position: relative;
    padding-left: 28px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.privacy-info-card li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #8bc34a;
    font-weight: bold;
    font-size: 18px;
}

.data-actions-card .section-desc {
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.actions-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}

.action-box {
    background-color: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
}

.action-box h4 {
    font-size: 16px;
    font-weight: 600;
}

.action-box p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.danger-zone {
    border-color: rgba(239, 83, 80, 0.2);
    background: linear-gradient(180deg, rgba(18, 9, 29, 0) 0%, rgba(239, 83, 80, 0.02) 100%);
}

.danger-zone h4 {
    color: var(--danger);
}

.btn-danger {
    background-color: rgba(239, 83, 80, 0.05);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-danger:hover {
    background-color: var(--danger);
    color: #ffffff;
}

.file-upload-wrapper label {
    display: block;
    width: 100%;
}

/* Tab Switching Control */
.tab-content {
    display: none;
}

.tab-content.active-tab {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

.hidden {
    display: none !important;
}

/* Responsiveness */
@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 24px;
    }
    .brand {
        margin-bottom: 24px;
    }
    .nav-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }
    .nav-item {
        padding: 10px 16px;
        white-space: nowrap;
    }
    .main-content {
        padding: 32px 24px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
