/* ===== HERMETIKA - GLOBAL STYLES ===== */

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

:root {
    --primary: #2c1a4d;
    --secondary: #d4af37;
    --bg-dark: #0f0a1e;
    --text-light: #f5f5f5;
    --accent: #7c3aed;
    --border-color: rgba(212, 175, 55, 0.3);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Safe area for notched devices */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Remove tap highlight on mobile */
* {
    -webkit-tap-highlight-color: transparent;
}


/* Particle canvas background */
.particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(to bottom, var(--bg-primary) 0%, var(--bg-secondary) 50%, #1A2432 100%);
    pointer-events: none;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 10;
    /* Ensure content is above background */
    isolation: isolate;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Cinzel', serif;
}

.hero-title {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-logo {
    height: 156px;
    width: auto;
    display: inline-block;
}

.hero-description {
    text-align: center;
    color: #d4af37;
    max-width: 600px;
    margin: 0 auto 50px;
    font-size: 1.3em;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Navigation */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 20px;
}

.nav-logo {
    display: flex;
    align-items: center;
}

.nav-brand {
    font-family: 'Cinzel', serif;
    color: var(--secondary);
    font-size: 1.2em;
    font-weight: 600;
    letter-spacing: 2px;
}

.nav-logo-img {
    height: 45px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.95em;
}

.nav-link:hover {
    color: var(--secondary);
}

.btn-sm {
    padding: 8px 20px;
    font-size: 0.9em;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1em;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: #000;
    border-color: #d4af37;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #e5c045, #d4af37);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: #fff;
    border-color: #7c3aed;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--secondary);
    border-color: var(--secondary);
}

.btn-outline:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: #e5c045;
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.1em;
}

/* Module Cards (Homepage) */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-2xl);
    margin: var(--space-3xl) 0;
    perspective: 2000px;
}

.module-card {
    background: rgba(20, 30, 42, 0.4);
    backdrop-filter: blur(var(--blur-md));
    -webkit-backdrop-filter: blur(var(--blur-md));
    border: 1px solid rgba(199, 164, 74, 0.15);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    text-align: center;
    transition: all var(--transition-slow) var(--easing-smooth);
    box-shadow: var(--shadow-md);
    transform-style: preserve-3d;
    position: relative;
    overflow: hidden;
}

/* Subtle shimmer overlay */
.module-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 30%,
            rgba(199, 164, 74, 0.05) 50%,
            transparent 70%);
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity var(--transition-slow);
    pointer-events: none;
}

.module-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        var(--shadow-lg),
        0 0 30px rgba(199, 164, 74, 0.2);
    background: rgba(20, 30, 42, 0.6);
}

.module-card:hover::after {
    opacity: 1;
    animation: shimmer 2s ease-in-out infinite;
}

.module-icon {
    font-size: 3em;
    margin-bottom: var(--space-md);
}

.module-image {
    width: 180px;
    height: 180px;
    object-fit: contain;
    transition: all var(--transition-slow) var(--easing-bounce);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.module-card:hover .module-image {
    transform: scale(1.1) translateY(-8px);
    filter: drop-shadow(0 12px 24px rgba(199, 164, 74, 0.4));
}

.module-title {
    color: var(--accent-gold);
    font-size: var(--fluid-xl);
    margin-bottom: var(--space-md);
    font-family: var(--font-display);
}

.module-description {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}

.module-features {
    list-style: none;
    margin: var(--space-lg) 0;
    text-align: left;
}

.module-features li {
    color: var(--text-secondary);
    padding: var(--space-sm) 0;
    padding-left: 28px;
    position: relative;
    font-size: var(--font-size-sm);
}

.module-features li:before {
    content: "✓";
    color: var(--accent-gold);
    position: absolute;
    left: 0;
    font-weight: bold;
    font-size: 1.1em;
}

/* Page Headers */
.page-header {
    text-align: center;
    margin-bottom: 30px;
}

.back-link {
    display: inline-block;
    color: var(--secondary);
    text-decoration: none;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: #e5c045;
    transform: translateX(-5px);
}

.page-title {
    font-size: 2.2em;
    color: var(--secondary);
    margin-bottom: 10px;
}

.page-subtitle {
    color: #999;
    font-size: 1.1em;
}

/* Forms */
.form-container {
    max-width: 700px;
    margin: 0 auto;
}

.birth-form,
.tarot-form {
    background: rgba(42, 26, 77, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    backdrop-filter: blur(10px);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 1em;
    font-family: 'Inter', sans-serif;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.form-group small {
    display: block;
    color: #888;
    margin-top: 5px;
    font-size: 0.85em;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

/* Mystic Inputs */
.input-mystic-wrapper {
    position: relative;
    width: 100%;
}

.input-mystic {
    width: 100%;
    background: rgba(20, 30, 42, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(199, 164, 74, 0.2);
    border-radius: 8px;
    padding: 12px 12px 12px 40px;
    /* Space for icon */
    color: var(--text-light);
    font-size: 1em;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.input-mystic:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
    background: rgba(20, 30, 42, 0.8);
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0.7;
}

.input-mystic:focus+.input-icon {
    opacity: 1;
    color: var(--accent);
}

.input-icon svg {
    width: 18px;
    height: 18px;
}

.form-note {
    background: rgba(124, 58, 237, 0.1);
    border-left: 4px solid var(--accent);
    padding: 20px;
    margin: 25px 0;
    border-radius: 6px;
}

.form-note h4 {
    color: var(--secondary);
    margin-bottom: 10px;
}

.form-note p,
.form-note ul {
    color: #aaa;
    font-size: 0.95em;
}

.form-note ul {
    margin-left: 20px;
    margin-top: 10px;
}

.form-note li {
    margin: 5px 0;
}

.note-footer {
    margin-top: 15px;
    font-style: italic;
    color: #999;
}

/* Results */
.result-header {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: rgba(42, 26, 77, 0.3);
    border-radius: 12px;
}

.result-name {
    color: var(--secondary);
    font-size: 2em;
    margin-bottom: 10px;
}

.result-info {
    color: #aaa;
    font-size: 1.1em;
}

.actions-bar {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

/* Planets Table */
.planets-table-container {
    margin: 30px 0;
}

.section-title {
    font-size: 1.8em;
    color: var(--secondary);
    margin: 30px 0 20px;
    text-align: center;
}

/* Table wrapper for horizontal scroll on mobile */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -20px;
    padding: 0 20px;
    position: relative;
}

/* Scroll indicator shadow */
.table-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to left, rgba(15, 10, 30, 0.8), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

@media (max-width: 768px) {
    .table-wrapper::after {
        opacity: 1;
    }
}

.planets-table {
    width: 100%;
    min-width: 500px;
    /* Prevents table from being too cramped */
    border-collapse: collapse;
    background: rgba(42, 26, 77, 0.3);
    border-radius: 12px;
    overflow: hidden;
}

.planets-table thead {
    background: var(--primary);
}

.planets-table th {
    color: var(--secondary);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.planets-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.planets-table tr:last-child td {
    border-bottom: none;
}

.planet-icon,
.sign-emoji {
    font-size: 1.3em;
    margin-right: 8px;
}

/* Interpretations */
.interpretations {
    display: grid;
    gap: 25px;
    margin: 30px 0;
}

.interpretation-card {
    background: rgba(42, 26, 77, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
}

.interp-title {
    color: var(--secondary);
    font-size: 1.3em;
    margin-bottom: 15px;
}

.interp-section {
    margin: 15px 0;
}

.interp-section h5 {
    color: #d4af37;
    margin-bottom: 8px;
    font-size: 1.05em;
}

.interp-section p {
    color: #ccc;
    line-height: 1.6;
}

.keywords {
    color: #999;
    font-size: 0.9em;
    margin-top: 8px;
}

/* CTA Banner */
.cta-banner {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(212, 175, 55, 0.15));
    border: 2px solid var(--secondary);
    border-radius: 16px;
    padding: 35px;
    margin: 35px 0;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.25);
    position: relative;
    overflow: hidden;
}

.cta-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.cta-icon {
    font-size: 3.5em;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-title {
    font-family: 'Cinzel', serif;
    color: var(--secondary);
    font-size: 2em;
    margin-bottom: 16px;
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

.cta-description {
    color: #e8e8e8;
    font-size: 1.15em;
    line-height: 1.7;
    margin-bottom: 24px;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}

.cta-features {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin: 24px 0;
}

.cta-feature {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 0.95em;
    color: #d4af37;
    border: 1px solid rgba(212, 175, 55, 0.4);
    transition: all 0.3s ease;
}

.cta-feature:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: #d4af37;
    transform: translateY(-2px);
}

.cta-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 28px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

/* Footer */
.footer {
    text-align: center;
    margin: 60px 0 20px;
    padding: 30px 0;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    color: #888;
}

.footer-note {
    color: #666;
    font-size: 0.9em;
    margin-top: 10px;
}

.result-footer {
    text-align: center;
    margin: 40px 0 20px;
    color: #888;
    font-size: 0.95em;
}

/* Responsive */

/* Global Grid Styles */
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    align-items: start;
    /* Critical: Prevents row expansion when one card expands */
}

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .container {
        padding: 16px;
    }

    .modules-grid {
        grid-template-columns: 1fr;
        max-width: 600px;
        margin: 30px auto;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2em;
        gap: 10px;
        margin-bottom: 15px;
    }

    .hero-logo {
        height: 100px;
    }

    .hero-description {
        font-size: 1.1em;
        margin-bottom: 35px;
        padding: 0 10px;
    }

    .module-card {
        padding: 25px;
    }

    .module-image {
        width: 140px;
        height: 140px;
    }

    .module-title {
        font-size: 1.6em;
    }

    .module-description {
        font-size: 0.95em;
    }

    .page-title {
        font-size: 1.8em;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        text-align: center;
        min-height: 48px;
        /* Touch-friendly */
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .container {
        padding: 12px;
    }

    .hero-title {
        font-size: 1.8em;
        margin-bottom: 12px;
    }

    .hero-logo {
        height: 80px;
    }

    .hero-description {
        font-size: 1em;
        margin-bottom: 30px;
        line-height: 1.5;
    }

    .modules-grid {
        gap: 20px;
        margin: 25px 0;
    }

    .module-card {
        padding: 20px;
        border-radius: 12px;
    }

    .module-icon {
        margin-bottom: 8px;
    }

    .module-image {
        width: 120px;
        height: 120px;
    }

    .module-title {
        font-size: 1.4em;
        margin-bottom: 12px;
    }

    .module-description {
        font-size: 0.9em;
        margin-bottom: 15px;
    }

    .module-features {
        font-size: 0.9em;
    }

    .module-features li {
        padding: 4px 0;
    }

    .btn {
        width: 100%;
        padding: 14px 25px;
        font-size: 1em;
        min-height: 50px;
    }

    .btn-large {
        padding: 16px 30px;
        font-size: 1.05em;
        min-height: 54px;
    }

    .page-header {
        margin-bottom: 20px;
    }

    .page-title {
        font-size: 1.6em;
    }

    .page-subtitle {
        font-size: 0.95em;
    }

    .birth-form,
    .tarot-form {
        padding: 20px;
    }

    .form-group label {
        font-size: 0.95em;
    }

    .form-group input,
    .form-group select {
        padding: 14px;
        font-size: 16px;
        /* Prevents zoom on iOS */
        min-height: 48px;
    }

    .section-title {
        font-size: 1.5em;
        margin: 20px 0 15px;
    }

    /* Better table scroll on mobile */
    .table-wrapper {
        margin: 0 -12px;
        padding: 0 12px;
        position: relative;
    }

    /* Add scroll hint shadow */
    .table-wrapper::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 20px;
        background: linear-gradient(to left, rgba(15, 10, 30, 0.9), transparent);
        pointer-events: none;
    }

    .planets-table {
        font-size: 0.7em;
        min-width: 100%;
        table-layout: fixed;
    }

    .planets-table th,
    .planets-table td {
        padding: 4px 2px;
        font-size: 1em;
        line-height: 1.3;
    }

    .planets-table th {
        font-size: 0.9em;
        padding: 6px 2px;
    }

    .planet-icon,
    .sign-emoji {
        font-size: 0.9em;
        margin-right: 2px;
    }

    /* Planet icons from images */
    .planets-table img {
        width: 14px !important;
        height: 14px !important;
        margin-right: 2px !important;
    }

    .footer {
        margin: 40px 0 15px;
        padding: 20px 0;
        font-size: 0.85em;
    }

    /* Card grids */
    .cards-grid-result {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .result-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Small phones */
@media (max-width: 360px) {
    .hero-logo {
        height: 70px;
    }

    .module-image {
        width: 100px;
        height: 100px;
    }

    .module-title {
        font-size: 1.3em;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.95em;
    }
}

/* Dark mode specific (already dark by default) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-light);
    -webkit-box-shadow: 0 0 0px 1000px rgba(0, 0, 0, 0.3) inset;
    transition: background-color 5000s ease-in-out 0s;
}