:root {
    --primary-color: #9d4edd;
    --secondary-color: #240046;
    --text-color: #e0aaff;
    --accent-color: #ff9e00;
    --bg-color: #10002b;
}

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    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;
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-family: 'Cinzel', serif;
    color: var(--accent-color);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(255, 158, 0, 0.5);
}

.form-card, .result-card {
    background: rgba(36, 0, 70, 0.8);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #c77dff;
}

input[type="date"], select {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid var(--primary-color);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box; 
    /* Fix for input width overflowing container */
}

/* Fix calendar icon color in dark mode */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.period-selector {
    display: flex;
    gap: 10px;
}

.period-selector input[type="radio"] {
    display: none;
}

.period-selector label {
    flex: 1;
    text-align: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0;
}

.period-selector input[type="radio"]:checked + label {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 0 15px var(--primary-color);
}

button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #7b2cbf, #9d4edd);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    font-family: 'Cinzel', serif;
}

button:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.6);
}

.hidden {
    display: none;
}

#result h2 {
    font-family: 'Cinzel', serif;
    color: var(--accent-color);
    margin-top: 0;
}

#horoscopeText {
    line-height: 1.6;
    font-size: 1.1rem;
    white-space: pre-wrap;
}

.meta {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #999;
    text-align: right;
    font-style: italic;
}

.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    -webkit-animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { -webkit-transform: rotate(360deg); }
}
