:root {
    --bg-dark: #0f172a;
    --primary: #10b981;
    --primary-hover: #059669;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Tajawal', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

.background-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.5;
    animation: float 10s infinite alternate ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: #047857;
    top: -50px;
    right: -50px;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: #1d4ed8;
    bottom: -100px;
    left: -100px;
    animation-delay: -5s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: #059669;
    top: 40%;
    left: 20%;
    animation-duration: 15s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 30px) scale(1.1); }
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(to right, #34d399, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-group.half {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-main);
}

input, select {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Adjust select options text color to prevent unreadable text in dark mode depending on OS/Browser */
select option {
    background-color: var(--bg-dark);
    color: var(--text-main);
}

.radio-group {
    display: flex;
    gap: 10px;
}

.radio-card {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.radio-card input {
    position: absolute;
    opacity: 0;
}

.card-content {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.radio-card input:checked + .card-content {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-primary {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(to right, #10b981, #059669);
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.hidden {
    display: none;
}

.result-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
    animation: slideUp 0.5s ease forwards;
}

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

.result-section h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-align: center;
}

.result-cards {
    display: flex;
    gap: 15px;
}

.res-card {
    flex: 1;
    padding: 15px;
    border-radius: 16px;
    text-align: center;
}

.res-card.primary {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.res-card.secondary {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.res-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.res-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.res-value .unit {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
}

.warning-alert {
    margin-top: 15px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--danger);
    border-radius: 8px;
    color: #fca5a5;
    font-size: 0.9rem;
}

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .result-cards {
        flex-direction: column;
    }
}
