:root {
    --primary-bg: #0f0c29;
    --secondary-bg: #302b63;
    --accent-bg: #24243e;
    --text-color: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.2);
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --glow-color: #a8efff;
    --gold-color: #ffd700;
    --fire-color: #ff6b6b;
    --water-color: #4facfe;
    --air-color: #a0ffe6;
    --earth-color: #76b852;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Lato', sans-serif;
}

body {
    min-height: 100vh;
    background: radial-gradient(circle at center, var(--secondary-bg), var(--primary-bg));
    color: var(--text-color);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: 
        radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 3px),
        radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 2px),
        radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 3px);
    background-size: 550px 550px, 350px 350px, 250px 250px;
    background-position: 0 0, 40px 60px, 130px 270px;
    animation: starMove 60s linear infinite;
    opacity: 0.6;
}

@keyframes starMove {
    from { transform: translateY(0); }
    to { transform: translateY(-550px); }
}

/* Header */
.main-header {
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(5px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header h1 {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
    background: linear-gradient(to right, #fff, #a8efff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.btn-glass:hover {
    background: rgba(255,255,255,0.2);
    box-shadow: 0 0 15px var(--glow-color);
}

/* Hero */
.hero {
    text-align: center;
    padding: 2rem 1rem;
    margin-bottom: 2rem;
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.8);
    max-width: 600px;
    margin: 0 auto;
}

/* Grid */
.zodiac-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
    flex: 1;
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.4);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4), 0 0 20px var(--glow-color);
}

.card .icon-wrapper {
    font-size: 4rem;
    margin-bottom: 1rem;
    transition: transform 0.4s ease;
    text-shadow: 0 0 20px rgba(255,255,255,0.4);
}

.card:hover .icon-wrapper {
    transform: scale(1.1);
    text-shadow: 0 0 30px var(--glow-color);
}

.card h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.card p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 1rem;
}

.card .element-indicator {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.hidden {
    display: none;
}

.modal-content.glass-panel {
    background: rgba(30, 30, 45, 0.95);
    border: 1px solid var(--glass-border);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 20px;
    padding: 2.5rem;
    position: relative;
    overflow-y: auto;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    color: #fff;
    animation: modalSlide 0.4s ease-out;
}

@keyframes modalSlide {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--fire-color);
}

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 1rem;
}

.zodiac-icon-large {
    font-size: 6rem;
    display: block;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 40px var(--glow-color);
}

.modal-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
    font-family: 'Cinzel', serif;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gold-color);
    transition: width 0.3s;
}

.tab-btn.active, .tab-btn:hover {
    color: #fff;
}

.tab-btn.active::after {
    width: 100%;
}

.tab-content {
    display: none;
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.9);
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Match Section */
.match-section {
    text-align: center;
}

.match-list {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
}

.match-badge {
    background: rgba(255,255,255,0.1);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.2);
}

.match-calculator {
    background: rgba(0,0,0,0.3);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 2rem;
}

.calc-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    align-items: center;
}

select {
    padding: 0.8rem;
    border-radius: 8px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 1rem;
    width: 200px;
}

select option {
    background: #1a0b2e;
}

.btn-gold {
    background: linear-gradient(135deg, #ffd700, #fdb931);
    color: #333;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-gold:hover {
    transform: scale(1.05);
}

.match-result {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--gold-color);
    margin-top: 1rem;
}

.main-footer {
    text-align: center;
    padding: 2rem;
    margin-top: auto;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .zodiac-grid {
        padding: 1rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }
    
    .zodiac-icon-large {
        font-size: 4rem;
    }
    
    .modal-header h2 {
        font-size: 1.8rem;
    }
    
    .calc-controls {
        flex-direction: column;
    }
}
