* { margin: 0; padding: 0; box-sizing: border-box; }

/* Language Selector Styling */
.language-selector {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
}

.language-selector select {
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #9333ea;
    background: white;
    color: #333;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

/* Hide the default arrow in IE10 and IE11 */
.language-selector select::-ms-expand {
    display: none;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .language-selector {
        top: 15px;
        left: 15px;
    }
    
    .language-selector select {
        padding: 8px 30px 8px 12px;
        font-size: 13px;
    }
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #1a0033 0%, #2d0a4e 25%, #1a1a3e 50%, #0f0f2e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 80%, white, transparent);
    background-size: 200% 200%;
    animation: stars 60s linear infinite;
    opacity: 0.5;
}

@keyframes stars {
    0% { transform: rotate(0deg) translateY(0); }
    100% { transform: rotate(360deg) translateY(-100px); }
}

.container {
    max-width: 700px;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
    padding: 50px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    max-height: 90vh;
    overflow-y: auto;
}

.container::-webkit-scrollbar { width: 8px; }
.container::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.container::-webkit-scrollbar-thumb { background: #9333ea; border-radius: 10px; }

.bg-number {
    position: absolute;
    font-size: 200px;
    font-weight: 800;
    color: rgba(147, 51, 234, 0.05);
    z-index: 0;
    pointer-events: none;
}

.bg-number-1 { top: -50px; right: 50px; }
.bg-number-2 { bottom: -80px; left: -20px; }

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 10px;
    margin-bottom: 40px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #9333ea, #c084fc);
    border-radius: 10px;
    transition: width 0.4s ease;
    width: 0%;
}

.logo { text-align: center; margin-bottom: 20px; }

.logo-text {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(90deg, #ff6b00, #9333ea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 15px;
    text-align: center;
}

.subtitle {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
}

.form-step { display: none; }
.form-step.active { display: block; animation: fadeIn 0.4s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

label {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 20px;
    text-align: center;
}

input[type="text"], select {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    background: white;
}

input:focus, select:focus {
    outline: none;
    border-color: #9333ea;
    box-shadow: 0 0 0 4px rgba(147, 51, 234, 0.1);
}

.date-inputs {
    display: grid;
    grid-template-columns: 1fr 2fr 1.5fr;
    gap: 15px;
    margin-bottom: 30px;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

button {
    flex: 1;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #9333ea, #c084fc);
    color: white;
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(147, 51, 234, 0.4);
}

.btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
}

.btn-secondary:hover { background: #e5e7eb; }

.loading { text-align: center; padding: 40px 0; }

.dice-loader {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    animation: spin 2s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

.loading-text { font-size: 18px; color: #6b7280; margin-top: 20px; }

.results { animation: fadeIn 0.6s ease; }

.result-title {
    font-size: 26px;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    margin-bottom: 15px;
}

.result-subtitle {
    font-size: 15px;
    color: #6b7280;
    text-align: center;
    margin-bottom: 30px;
    line-height: 1.6;
}

.number-card {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    padding: 20px;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from { transform: translateX(-30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.number-card.green { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3); }
.number-card.purple { background: linear-gradient(135deg, #a78bfa, #8b5cf6); box-shadow: 0 4px 15px rgba(167, 139, 250, 0.3); }
.number-card.yellow { background: linear-gradient(135deg, #fde047, #facc15); box-shadow: 0 4px 15px rgba(253, 224, 71, 0.3); }
.number-card.orange { background: linear-gradient(135deg, #fb923c, #f97316); box-shadow: 0 4px 15px rgba(251, 146, 60, 0.3); }
.number-card.blue { background: linear-gradient(135deg, #93c5fd, #60a5fa); box-shadow: 0 4px 15px rgba(147, 197, 253, 0.3); }

.number-card-label {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.number-card-value {
    font-size: 36px;
    font-weight: 800;
    color: #1f2937;
    background: rgba(255, 255, 255, 0.9);
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.challenge-section {
    background: linear-gradient(135deg, #e9d5ff, #c084fc);
    padding: 25px;
    border-radius: 15px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(192, 132, 252, 0.3);
}

.challenge-header {
    font-size: 18px;
    font-weight: 600;
    color: #581c87;
    margin-bottom: 15px;
}

.challenge-numbers {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.challenge-box {
    background: linear-gradient(135deg, #9333ea, #7e22ce);
    color: white;
    font-size: 32px;
    font-weight: 700;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(147, 51, 234, 0.4);
}

.info-section {
    background: #f9fafb;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    border-left: 4px solid #9333ea;
}

.info-section h3 { font-size: 18px; color: #1f2937; margin-bottom: 10px; }

.info-section ul { margin-left: 20px; margin-top: 10px; }

.info-section li {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 5px;
}

.home-link {
    display: block;
    text-align: center;
    margin-top: 30px;
    padding: 15px;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.home-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.4);
}

/* Language Selector - Fixed positioning for all environments */
.language-selector {
    position: fixed !important;
    top: 20px !important;
    left: ;: 20px !important;
    z-index: 9999 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.language-selector select {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Download Button - Force visibility */
#downloadReportBtn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 100 !important;
}

@media (max-width: 768px) {
    .container { padding: 30px 20px; }
    h1, .result-title { font-size: 22px; }
    .date-inputs { grid-template-columns: 1fr; }
    .challenge-numbers { grid-template-columns: repeat(2, 1fr); }
    .number-card { flex-direction: column; text-align: center; gap: 15px; }
    
    /* Ensure language selector is visible on mobile */
    .language-selector {
        top: 10px !important;
        left: ;: 10px !important;
    }
    
    .language-selector select {
        font-size: 12px !important;
        padding: 8px 12px !important;
    }
}
