:root {
    --bg-color: #050b14;
    --primary-color: #4a90e2;
    --secondary-color: #e2a84a;
    --text-color: #f0f4f8;
    --text-muted: #a0aec0;
    --card-bg: rgba(20, 30, 48, 0.6);
    --border-color: rgba(241, 137, 137, 0.1);
    --success: #38a169;
    --danger: #e53e3e;
}

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

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

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-color: #02050a;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(74, 144, 226, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(226, 168, 74, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(100, 50, 200, 0.05) 0%, transparent 50%);
    overflow: hidden;
}

/* Stars Effect */
.background-animation::before {
    content: "";
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, #eee, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 40px 70px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 50px 160px, #ddd, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 90px 40px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 130px 80px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 160px 120px, #ddd, rgba(0, 0, 0, 0));
    background-repeat: repeat;
    background-size: 200px 200px;
    opacity: 0.3;
    animation: star-drift 100s linear infinite;
}

/* Nebula Glow */
.background-animation::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(74, 144, 226, 0.03) 0%, transparent 70%);
    animation: pulse 10s ease-in-out infinite alternate;
}

@keyframes star-drift {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    from {
        opacity: 0.5;
        transform: scale(1);
    }

    to {
        opacity: 1;
        transform: scale(1.1);
    }
}

.container {
    max-width: 1200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 0.05rem;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.highlight {
    color: var(--primary-color);
}

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

.current-date-display {
    color: var(--secondary-color) !important;
    font-size: 0.95rem !important;
    font-weight: 500;
    margin-top: 0.8rem;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    height: 100%;
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.8rem;
    text-align: center;
    letter-spacing: 1px;
}

.hijri-text {
    text-align: center;
    margin-top: -1rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    font-weight: 500;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

input {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
    appearance: textfield;
    -moz-appearance: textfield;
}

#date-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
    padding-right: 2.5rem;
}

/* Remove spin buttons (Chrome, Safari, Edge, Opera) */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
}

/* Make calendar icon white in supported browsers */
input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.3);
}

.coordinates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.map-container {
    margin-bottom: 1.5rem;
}

.map-container label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

#map {
    height: 350px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #111;
}

/* Custom Cursors with Outlines for Map Dragging */
.leaflet-grab {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='white' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 11V6a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v0'/%3E%3Cpath d='M14 10V4a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v0'/%3E%3Cpath d='M10 10.5V6a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v0'/%3E%3Cpath d='M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15'/%3E%3C/svg%3E") 10 10, grab !important;
}

.leaflet-grabbing {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='white' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 5a2 2 0 1 0-4 0v5.5a.5.5 0 0 1-1 0V8a2 2 0 1 0-4 0v9a7 7 0 1 0 14 0V9a2 2 0 1 0-4 0v5.5a.5.5 0 0 1-1 0V6a2 2 0 1 0-4 0v4.5a.5.5 0 0 1-1 0z'/%3E%3C/svg%3E") 10 10, grabbing !important;
}

/* Geocoder Styling (Search Box) */
.leaflet-control-geocoder {
    border-radius: 8px !important;
    background: white !important;
    border: 1px solid var(--border-color) !important;
}

.leaflet-control-geocoder-form input {
    color: #333 !important;
    background: transparent !important;
    border: none !important;
    padding: 6px 10px !important;
}


.btn-calculate {
    width: 100%;
    padding: 1rem;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), #2d6cc0);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.6);
}

.btn-calculate:active {
    transform: translateY(1px);
}

/* Results Section */
.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-item {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.result-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.06);
}

.result-item .icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.result-item .label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.result-item .value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Criteria Section */
.criteria-box {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.criteria-box h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.criteria-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--border-color);
    transition: border-color 0.3s;
}

.crit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
}

.status-badge.meet {
    background: rgba(56, 161, 105, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-badge.fail {
    background: rgba(229, 62, 62, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.criteria-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.note {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 1.5rem;
    opacity: 0.8;
}

.footer-credit {
    text-align: center;
    padding: 2rem 0 1.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    opacity: 0.6;
}
