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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 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: #FFD700;
    text-decoration: none;
    font-size: 1.1em;
    transition: all 0.3s ease;
    padding: 10px 15px;
    border-radius: 20px;
    background: rgba(255, 215, 0, 0.1);
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateX(-5px);
}

.header h1 {
    font-size: 3.5em;
    color: #fff;
    text-shadow: 2px 2px 10px rgba(255, 215, 0, 0.5);
    margin-bottom: 15px;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FF6347, #DA70D6, #9370DB);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: numerologyGlow 3s ease-in-out infinite alternate;
}

.subtitle {
    font-size: 1.3em;
    color: #FFD700;
    font-style: italic;
    text-shadow: 1px 1px 5px rgba(255, 215, 0, 0.3);
    margin-bottom: 20px;
}

@keyframes numerologyGlow {
    from { 
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 0 40px rgba(255, 165, 0, 0.3); 
    }
    to { 
        text-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 165, 0, 0.6); 
    }
}



.numerology-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);
}

.calculator-types {
    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);
}

.calculator-types h2 {
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 30px;
    color: #FFD700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

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

.calc-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;
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.calc-option-btn.active {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

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

.option-icon {
    font-size: 2.5em;
    margin-bottom: 5px;
}

.option-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #FFD700;
}

.option-desc {
    font-size: 0.9em;
    color: #B8B8D4;
    text-align: center;
}

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

.calculator-section h2 {
    color: #FFD700;
    font-size: 2em;
    margin-bottom: 15px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.calc-description {
    color: #E6E6FA;
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 30px;
    text-align: center;
}

.input-section {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.input-section label {
    display: block;
    font-size: 1.2em;
    color: #FFD700;
    margin-bottom: 15px;
    font-weight: bold;
}

.cosmic-input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    color: #ffffff;
    font-size: 1.1em;
    font-family: inherit;
    text-align: center;
    transition: border-color 0.3s ease;
}

.cosmic-input::placeholder {
    color: #B8B8D4;
    font-style: italic;
}

.cosmic-input:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.name-help {
    margin-bottom: 20px;
}

.name-help small {
    color: #B8B8D4;
    font-style: italic;
}

.calculate-btn {
    padding: 15px 40px;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FF6347);
    color: #1a1a2e;
    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(255, 215, 0, 0.3);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    margin-top: 10px;
}

.calculate-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 215, 0, 0.6);
}

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

.results-section {
    background: rgba(13, 13, 30, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 215, 0, 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(255, 215, 0, 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);
    }
}

.results-section h2 {
    text-align: center;
    font-size: 2.2em;
    margin-bottom: 30px;
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.number-result {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.result-number {
    font-size: 4em;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    animation: numberPulse 2s ease-in-out infinite alternate;
}

@keyframes numberPulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.result-type {
    font-size: 1.5em;
    color: #FFA500;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
}

.cosmic-interpretation,
.personality-traits,
.life-guidance,
.compatibility-section {
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border-left: 4px solid #FFD700;
}

.cosmic-interpretation h3,
.personality-traits h3,
.life-guidance h3,
.compatibility-section h3 {
    color: #FFD700;
    font-size: 1.4em;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.interpretation-text,
.traits-text,
.guidance-text,
.compatibility-text {
    color: #E6E6FA;
    line-height: 1.7;
    font-size: 1.1em;
}

.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, #FF6347);
    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);
}

.master-numbers-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);
}

.master-numbers-info h2 {
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #FFD700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.master-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.master-card {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.master-card:hover {
    transform: translateY(-5px);
    border-color: #FFD700;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 215, 0, 0.3);
}

.master-number {
    font-size: 3em;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 10px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.master-title {
    font-size: 1.3em;
    font-weight: bold;
    color: #FFA500;
    margin-bottom: 10px;
}

.master-desc {
    color: #E6E6FA;
    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: #FFD700;
    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: #FFA500;
    animation-duration: 1.2s;
    animation-direction: reverse;
}

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

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

.loading p {
    color: #FFD700;
    font-style: italic;
    font-size: 1.1em;
    text-shadow: 0 0 10px rgba(255, 215, 0, 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;
    }
    
    .calc-options {
        grid-template-columns: 1fr;
    }
    
    .calc-option-btn {
        padding: 15px;
    }
    
    .master-grid {
        grid-template-columns: 1fr;
    }
    
    .result-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .control-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .calculate-btn {
        width: 100%;
        max-width: 300px;
    }
}