@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-dark: hsl(220, 25%, 8%);
    --bg-darker: hsl(220, 30%, 4%);
    --card-bg: hsla(220, 20%, 12%, 0.7);
    --card-border: hsla(220, 20%, 25%, 0.4);
    
    --color-text: hsl(210, 20%, 90%);
    --color-text-muted: hsl(210, 10%, 65%);
    
    --color-turquoise: hsl(165, 80%, 45%);
    --color-turquoise-glow: hsla(165, 80%, 45%, 0.35);
    
    --color-gold: hsl(45, 90%, 52%);
    --color-gold-glow: hsla(45, 90%, 52%, 0.35);
    
    --color-red: hsl(0, 75%, 50%);
    --color-white: hsl(0, 0%, 95%);
    --color-blue: hsl(205, 80%, 50%);
    --color-yellow: hsl(48, 90%, 50%);
    --color-green: hsl(135, 60%, 45%);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 16px;
}

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

body {
    background: radial-gradient(circle at 50% 30%, var(--bg-dark) 0%, var(--bg-darker) 100%);
    color: var(--color-text);
    font-family: var(--font-body);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: 60px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-turquoise);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--card-border);
}

.logo-section h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-turquoise) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 10px hsla(0, 0%, 0%, 0.3);
}

.logo-section p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.controls-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Glassmorphism Buttons & Selects */
button, select, input[type="text"], input[type="date"] {
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--color-text);
    padding: 10px 18px;
    border-radius: var(--border-radius);
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    outline: none;
}

button:hover, select:hover, input[type="text"]:focus, input[type="date"]:focus {
    border-color: var(--color-turquoise);
    box-shadow: 0 0 12px var(--color-turquoise-glow);
    transform: translateY(-1px);
}

button.btn-accent {
    background: linear-gradient(135deg, var(--color-turquoise) 0%, hsl(165, 80%, 35%) 100%);
    border: none;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
button.btn-accent:hover {
    box-shadow: 0 0 16px var(--color-turquoise-glow);
}

/* Date Selector Ribbon */
.date-selector-ribbon {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 16px 24px;
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.date-selector-ribbon .nav-btn {
    font-family: var(--font-heading);
    font-weight: 600;
    min-width: 130px;
}

.date-selector-ribbon input[type="date"] {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    color: var(--color-turquoise);
    padding: 8px 16px;
}

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

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Card Styling */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 24px;
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-turquoise) 0%, var(--color-gold) 100%);
    opacity: 0.8;
}

.card h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 8px;
}

/* Tzolk'in Central Kin Presentation */
.kin-presentation {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.kin-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
}

.kin-number-badge {
    background: var(--color-gold);
    color: var(--bg-darker);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 0 12px var(--color-gold-glow);
}

.portal-badge {
    background: var(--color-turquoise);
    color: var(--bg-darker);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 0 12px var(--color-turquoise-glow);
    animation: portalPulse 2s infinite ease-in-out;
}

@keyframes portalPulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.glyph-showcase {
    position: relative;
    width: 260px;
    height: 260px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
}

.glyph-glow {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--color-turquoise-glow) 0%, transparent 70%);
    animation: rotateGlow 20s linear infinite;
    z-index: 1;
}

.glyph-showcase img.glyph-seal {
    width: 180px;
    height: 180px;
    object-fit: contain;
    z-index: 2;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.5));
    transition: var(--transition);
}

.glyph-showcase img.glyph-tone {
    position: absolute;
    top: 5px;
    width: 120px;
    height: 40px;
    object-fit: contain;
    z-index: 3;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

@keyframes rotateGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.kin-names h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-gold);
}

.kin-names .sub-names {
    color: var(--color-text-muted);
    font-size: 1rem;
    margin-top: 4px;
}

/* Attributes Badges Grid */
.attributes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    margin-top: 12px;
}

.attr-badge {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.85rem;
}

.attr-badge span {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.attr-badge strong {
    color: var(--color-text);
}

/* Custom tabs for detailed sections */
.tab-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 12px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 20px;
}

.tab-btn.active {
    background: var(--color-turquoise);
    color: var(--bg-darker);
    border-color: var(--color-turquoise);
}

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

.tab-content.active {
    display: block;
}

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

/* Oracle Cross View */
.oracle-cross {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.oracle-slot {
    position: absolute;
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 4px;
    transition: var(--transition);
}

.oracle-slot:hover {
    border-color: var(--color-gold);
    background: rgba(255,255,255,0.05);
}

.oracle-slot img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.oracle-slot span {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 2px;
    white-space: nowrap;
}

/* Positioning oracle slots */
.oracle-slot.destiny { z-index: 10; border-color: var(--color-gold); background: rgba(45, 90, 52, 0.1); width: 90px; height: 90px;}
.oracle-slot.destiny img { width: 60px; height: 60px; }
.oracle-slot.guide { top: 10px; }
.oracle-slot.analogue { right: 10px; }
.oracle-slot.antipodal { left: 10px; }
.oracle-slot.hidden { bottom: 10px; }

/* Wavespell row */
.wavespell-path {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    overflow-x: auto;
    padding: 10px 5px;
}

.wavespell-day {
    flex: 1;
    min-width: 50px;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 4px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.wavespell-day:hover {
    border-color: var(--color-turquoise);
    transform: scale(1.05);
}

.wavespell-day.active {
    background: var(--color-turquoise-glow);
    border-color: var(--color-turquoise);
    box-shadow: 0 0 10px var(--color-turquoise);
}

.wavespell-day img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.wavespell-day .tone-dot {
    font-size: 0.65rem;
    color: var(--color-gold);
    font-weight: 700;
}

/* Tun Uk 13 Moon Details Layout */
.tunuk-display {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.moon-circle-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.moon-circle-header img.moon-totem {
    width: 70px;
    height: 70px;
    object-fit: contain;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--card-border);
    padding: 8px;
    border-radius: 50%;
}

.moon-info-title h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--color-turquoise);
}

.moon-info-title p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.week-display-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.week-display-bar.week-1 { background: hsla(0, 75%, 35%, 0.3); border: 1px solid var(--color-red); color: hsl(0, 80%, 80%); }
.week-display-bar.week-2 { background: hsla(0, 0%, 50%, 0.2); border: 1px solid var(--color-white); color: var(--color-white); }
.week-display-bar.week-3 { background: hsla(205, 80%, 35%, 0.3); border: 1px solid var(--color-blue); color: hsl(205, 80%, 80%); }
.week-display-bar.week-4 { background: hsla(48, 90%, 35%, 0.3); border: 1px solid var(--color-yellow); color: hsl(48, 90%, 80%); }
.week-display-bar.week-0 { background: hsla(135, 60%, 35%, 0.3); border: 1px solid var(--color-green); color: hsl(135, 80%, 80%); }

/* Description sections text */
.text-section {
    margin-bottom: 16px;
}

.text-section h4 {
    font-family: var(--font-heading);
    color: var(--color-gold);
    margin-bottom: 4px;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.text-section p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-align: justify;
}

/* Interactive Tzolkin Grid */
.tzolkin-grid-container {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 4px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--card-border);
    padding: 10px;
    border-radius: 12px;
}

.tzolkin-cell {
    aspect-ratio: 0.9;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.tzolkin-cell:hover {
    background: var(--card-border);
    color: var(--color-text);
}

.tzolkin-cell.portal {
    background: rgba(165, 80, 45, 0.15);
    border-color: hsla(165, 80%, 45%, 0.3);
    color: var(--color-turquoise);
}

.tzolkin-cell.active {
    background: var(--color-gold);
    color: var(--bg-darker);
    border-color: var(--color-gold);
    box-shadow: 0 0 10px var(--color-gold-glow);
    font-weight: 700;
    transform: scale(1.1);
    z-index: 5;
}

.tzolkin-cell.red-race { border-bottom: 2px solid var(--color-red); }
.tzolkin-cell.white-race { border-bottom: 2px solid var(--color-white); }
.tzolkin-cell.blue-race { border-bottom: 2px solid var(--color-blue); }
.tzolkin-cell.yellow-race { border-bottom: 2px solid var(--color-yellow); }

/* Saved Profiles Section */
.profile-form {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.profile-form input[type="text"] {
    flex: 1;
}

.profile-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 4px;
}

.profile-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--card-border);
    padding: 10px 16px;
    border-radius: 8px;
    transition: var(--transition);
}

.profile-item:hover {
    background: rgba(255,255,255,0.06);
    border-color: var(--color-turquoise);
}

.profile-item-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.profile-item-info p {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.delete-profile-btn {
    background: rgba(255, 75, 75, 0.15);
    border: 1px solid rgba(255, 75, 75, 0.3);
    color: hsl(0, 100%, 75%);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.delete-profile-btn:hover {
    background: rgba(255, 75, 75, 0.35);
    box-shadow: 0 0 10px rgba(255,75,75,0.3);
}

/* Footer style */
footer {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid var(--card-border);
}
