/* Custom properties for Dark Mode Glassmorphism */
:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-primary: #818cf8;
    --accent-primary-hover: #6366f1;
    --accent-secondary: #fbbf24;
    --accent-secondary-hover: #f59e0b;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-primary-hover);
}

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

/* Header & Nav */
.site-header {
    padding: 20px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    border-radius: 50px;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.primary-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.primary-nav a {
    color: var(--text-muted);
    font-weight: 500;
}

.primary-nav a:hover {
    color: var(--text-main);
}

/* Main Content */
.site-main {
    flex: 1;
    padding: 40px 0;
}

/* Calculator Hero */
.calculator-hero {
    text-align: center;
    margin-bottom: 40px;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

/* Calculator Card */
.calculator-card {
    border-radius: 24px;
    padding: 40px;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.calc-view {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.calc-view.active-view {
    display: block;
}

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

.view-heading {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 25px;
}

/* Time Picker */
.time-picker-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
}

.glass-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 12px 16px;
    font-size: 1.2rem;
    border-radius: 12px;
    outline: none;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    text-align: center;
}

.glass-input:focus {
    border-color: var(--accent-primary);
}

.glass-input option {
    background: #1e293b;
    color: #fff;
}

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

/* Buttons */
.btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
}

.btn-glow {
    box-shadow: 0 0 20px rgba(129, 140, 248, 0.4);
}

.btn-glow:hover {
    box-shadow: 0 0 30px rgba(129, 140, 248, 0.6);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--accent-secondary);
    color: var(--accent-secondary);
}

.btn-secondary:hover {
    background: var(--accent-secondary);
    color: #000;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    margin-top: 20px;
}

.btn-outline:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

.divider {
    margin: 30px 0;
    position: relative;
}

.divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--glass-border);
}

.divider span {
    background: #151b3b;
    padding: 0 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* Results View */
.results-desc {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.result-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}

.result-item.optimal {
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(129, 140, 248, 0.2);
}

.result-item.optimal-wakeup {
    border-color: var(--accent-secondary);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.2);
}

.result-time {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
}

.result-cycles {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.results-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* SEO Content Area */
.content-glass {
    padding: 40px;
    border-radius: 24px;
    line-height: 1.6;
}

.content-glass h2, .content-glass h3 {
    color: var(--accent-primary);
    margin-top: 30px;
}

.text-left { text-align: left; }

/* AdSense Slot */
.adsense-slot {
    margin: 40px auto;
    text-align: center;
}

.adsense-placeholder {
    display: inline-block;
    width: 100%;
    max-width: 728px;
    height: 90px;
    background: rgba(0,0,0,0.3);
    border: 1px dashed var(--glass-border);
    line-height: 90px;
    color: var(--text-muted);
    border-radius: 8px;
}

/* Footer */
.site-footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    margin-top: 40px;
}

.footer-menu {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-menu a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-menu a:hover {
    color: var(--text-main);
}

.copyright, .disclaimer-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 5px 0;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .header-container { flex-direction: column; gap: 15px; border-radius: 20px; }
    .calculator-card { padding: 25px; border-radius: 20px; }
    .time-picker-container { gap: 5px; }
    .glass-input { padding: 10px 8px; font-size: 1rem; }
    .results-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 2rem; }
}
