/* Cosmic Horoscope Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e0a2e 0%, #2a1a5e 50%, #4a1a7a 100%);
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    color: #ffffff;
}

/* Animated Cosmic Background */
.cosmic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.stars, .twinkling {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.stars {
    background: transparent url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><radialGradient id="star"><stop offset="0%" stop-color="%23fff" stop-opacity="1"/><stop offset="100%" stop-color="%23fff" stop-opacity="0"/></radialGradient></defs><circle cx="20" cy="20" r="1" fill="url(%23star)"/><circle cx="60" cy="5" r="1" fill="url(%23star)"/><circle cx="90" cy="25" r="1" fill="url(%23star)"/><circle cx="30" cy="70" r="1" fill="url(%23star)"/><circle cx="80" cy="80" r="1" fill="url(%23star)"/></svg>') repeat;
    background-size: 200px 200px;
    animation: stars-move 120s linear infinite;
}

.twinkling {
    background: transparent url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><radialGradient id="twinkle"><stop offset="0%" stop-color="%23fff" stop-opacity="1"/><stop offset="100%" stop-color="%23fff" stop-opacity="0"/></radialGradient></defs><circle cx="15" cy="35" r="0.5" fill="url(%23twinkle)"/><circle cx="75" cy="15" r="0.8" fill="url(%23twinkle)"/><circle cx="45" cy="85" r="0.6" fill="url(%23twinkle)"/><circle cx="85" cy="60" r="0.4" fill="url(%23twinkle)"/></svg>') repeat;
    background-size: 300px 300px;
    animation: twinkling 100s linear infinite;
}

@keyframes stars-move {
    from { transform: translateY(0px); }
    to { transform: translateY(-2000px); }
}

@keyframes twinkling {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, #ffffff, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #ffffff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, #ffffff, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: twinkle 4s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    padding: 30px 20px;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #DA70D6;
    text-decoration: none;
    font-size: 1.1em;
    transition: all 0.3s ease;
    padding: 10px 15px;
    border-radius: 20px;
    background: rgba(218, 112, 214, 0.1);
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: rgba(218, 112, 214, 0.2);
    transform: translateX(-5px);
}

.header h1 {
    font-size: 3.5em;
    color: #fff;
    text-shadow: 2px 2px 10px rgba(218, 112, 214, 0.5);
    margin-bottom: 15px;
    background: linear-gradient(45deg, #DA70D6, #9370DB, #6A5ACD, #4B0082, #8A2BE2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: horoscopeGlow 3s ease-in-out infinite alternate;
}

.subtitle {
    font-size: 1.3em;
    color: #DA70D6;
    font-style: italic;
    text-shadow: 1px 1px 5px rgba(218, 112, 214, 0.3);
    margin-bottom: 20px;
}

@keyframes horoscopeGlow {
    from { 
        text-shadow: 0 0 20px rgba(218, 112, 214, 0.5), 0 0 40px rgba(147, 112, 219, 0.3); 
    }
    to { 
        text-shadow: 0 0 30px rgba(218, 112, 214, 0.8), 0 0 60px rgba(147, 112, 219, 0.6); 
    }
}



.horoscope-intro {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(13, 13, 30, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.mystical-text {
    font-size: 1.2em;
    line-height: 1.6;
    color: #E6E6FA;
    text-shadow: 0 0 10px rgba(230, 230, 250, 0.3);
}

.zodiac-selection {
    margin-bottom: 40px;
    background: rgba(13, 13, 30, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(218, 112, 214, 0.3);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.zodiac-selection h2 {
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 30px;
    color: #DA70D6;
    text-shadow: 0 0 15px rgba(218, 112, 214, 0.5);
}

.zodiac-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    max-width: 900px;
    margin: 0 auto;
}

.zodiac-card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

.zodiac-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(218, 112, 214, 0.2), transparent);
    transition: left 0.6s ease;
}

.zodiac-card:hover::before {
    left: 100%;
}

.zodiac-card:hover {
    transform: translateY(-5px);
    border-color: #DA70D6;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(218, 112, 214, 0.4);
}

.zodiac-card.selected {
    border-color: #DA70D6;
    background: rgba(218, 112, 214, 0.2);
    box-shadow: 0 0 25px rgba(218, 112, 214, 0.5);
    transform: translateY(-3px);
}

.sign-symbol {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #DA70D6;
    text-shadow: 0 0 15px rgba(218, 112, 214, 0.6);
}

.sign-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 5px;
}

.sign-dates {
    font-size: 0.9em;
    color: #B8B8D4;
    margin-bottom: 5px;
}

.sign-element {
    font-size: 0.8em;
    color: #9370DB;
    font-style: italic;
}

.horoscope-types {
    margin-bottom: 40px;
    background: rgba(13, 13, 30, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(147, 112, 219, 0.3);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.horoscope-types h2 {
    font-size: 1.8em;
    margin-bottom: 30px;
    color: #9370DB;
    text-shadow: 0 0 15px rgba(147, 112, 219, 0.5);
}

.type-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.type-option-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ffffff;
    text-align: center;
    min-width: 120px;
    backdrop-filter: blur(5px);
}

.type-option-btn.active {
    border-color: #9370DB;
    background: rgba(147, 112, 219, 0.2);
    box-shadow: 0 0 20px rgba(147, 112, 219, 0.3);
}

.type-option-btn:hover {
    transform: translateY(-3px);
    border-color: #9370DB;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.type-icon {
    display: block;
    font-size: 2em;
    margin-bottom: 10px;
}

.type-title {
    display: block;
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 5px;
    color: #9370DB;
}

.type-desc {
    display: block;
    font-size: 0.9em;
    color: #B8B8D4;
}

.get-reading-btn {
    padding: 15px 40px;
    background: linear-gradient(45deg, #DA70D6, #9370DB, #6A5ACD);
    color: #ffffff;
    border: none;
    border-radius: 25px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(218, 112, 214, 0.3);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.get-reading-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 30px rgba(218, 112, 214, 0.6);
}

.get-reading-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.selected-sign {
    margin-bottom: 40px;
    background: rgba(13, 13, 30, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(218, 112, 214, 0.3);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.sign-showcase {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.showcase-symbol {
    font-size: 4em;
    color: #DA70D6;
    text-shadow: 0 0 20px rgba(218, 112, 214, 0.8);
}

.showcase-info {
    text-align: center;
}

.showcase-name {
    font-size: 2em;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 5px;
}

.showcase-dates {
    font-size: 1.2em;
    color: #B8B8D4;
    margin-bottom: 5px;
}

.showcase-element {
    font-size: 1em;
    color: #9370DB;
    font-style: italic;
}

.horoscope-results {
    background: rgba(13, 13, 30, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(218, 112, 214, 0.3);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 25px rgba(218, 112, 214, 0.2);
    animation: resultsAppear 1s ease-out;
}

@keyframes resultsAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.horoscope-results h2 {
    text-align: center;
    font-size: 2.2em;
    margin-bottom: 30px;
    color: #DA70D6;
    text-shadow: 0 0 20px rgba(218, 112, 214, 0.6);
}

.reading-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(218, 112, 214, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(218, 112, 214, 0.3);
}

.reading-sign {
    font-size: 1.5em;
    font-weight: bold;
    color: #DA70D6;
    margin-bottom: 5px;
}

.reading-date {
    font-size: 1.1em;
    color: #B8B8D4;
    margin-bottom: 5px;
}

.reading-type {
    font-size: 1em;
    color: #9370DB;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cosmic-reading {
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border-left: 4px solid #DA70D6;
}

.cosmic-reading h3 {
    color: #DA70D6;
    font-size: 1.4em;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(218, 112, 214, 0.4);
}

.reading-text {
    color: #E6E6FA;
    line-height: 1.7;
    font-size: 1.1em;
    text-align: justify;
}

.cosmic-insights {
    margin-bottom: 30px;
}

.cosmic-insights h3 {
    color: #9370DB;
    font-size: 1.4em;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 0 0 10px rgba(147, 112, 219, 0.4);
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.insight-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(147, 112, 219, 0.3);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.insight-card:hover {
    transform: translateY(-3px);
    border-color: #9370DB;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.insight-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.insight-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #9370DB;
    margin-bottom: 10px;
}

.insight-text {
    color: #B8B8D4;
    line-height: 1.5;
    font-size: 0.9em;
}

.result-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 12px 25px;
    background: linear-gradient(45deg, #9370DB, #DA70D6, #6A5ACD);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(147, 112, 219, 0.6);
}

.astro-info {
    background: rgba(13, 13, 30, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.astro-info h2 {
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 30px;
    color: #DA70D6;
    text-shadow: 0 0 15px rgba(218, 112, 214, 0.5);
}

.elements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.element-card {
    border: 2px solid;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.element-card.fire {
    border-color: #FF6347;
    background: rgba(255, 99, 71, 0.1);
}

.element-card.earth {
    border-color: #8B4513;
    background: rgba(139, 69, 19, 0.1);
}

.element-card.air {
    border-color: #87CEEB;
    background: rgba(135, 206, 235, 0.1);
}

.element-card.water {
    border-color: #4682B4;
    background: rgba(70, 130, 180, 0.1);
}

.element-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.element-symbol {
    font-size: 2.5em;
    margin-bottom: 15px;
}

.element-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 10px;
}

.element-signs {
    font-size: 1em;
    color: #9370DB;
    margin-bottom: 15px;
    font-weight: bold;
}

.element-desc {
    color: #B8B8D4;
    line-height: 1.5;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    background: rgba(13, 13, 30, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    margin: 40px auto;
    max-width: 400px;
}

.cosmic-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: #DA70D6;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(2) {
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    border-top-color: #9370DB;
    animation-duration: 1.2s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
    border-top-color: #6A5ACD;
    animation-duration: 0.9s;
}

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

.loading p {
    color: #DA70D6;
    font-style: italic;
    font-size: 1.1em;
    text-shadow: 0 0 10px rgba(218, 112, 214, 0.4);
}

/* iOS Safari background fix */
@supports (-webkit-touch-callout: none) {
    body {
        background-attachment: scroll;
        background-size: 100% 100%;
        background-repeat: no-repeat;
    }
    
    body::before {
        position: absolute;
        background-attachment: scroll;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .header-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-btn, .admin-btn {
        width: 100%;
        justify-content: center;
    }
    
    .zodiac-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .zodiac-card {
        padding: 15px;
    }
    
    .sign-symbol {
        font-size: 2em;
    }
    
    .sign-name {
        font-size: 1em;
    }
    
    .sign-dates, .sign-element {
        font-size: 0.8em;
    }
    
    .type-options {
        flex-direction: column;
        align-items: center;
    }
    
    .type-option-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .insights-grid {
        grid-template-columns: 1fr;
    }
    
    .elements-grid {
        grid-template-columns: 1fr;
    }
    
    .sign-showcase {
        flex-direction: column;
        text-align: center;
    }
    
    .result-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .control-btn {
        width: 100%;
        max-width: 200px;
    }
}