:root {
    --bg-color: #0a1628;
    --bg-secondary: #0d1f3c;
    --text-primary: #f0ece2;
    --text-secondary: #a0b4c8;
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent-gold: #c9a94e;
    --accent-gold-light: #e8d48b;
    --accent-teal: #1a8a7a;
    --accent-teal-dark: #0d4f4f;
    --accent-green: #1a6b4a;
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-hover: rgba(255, 255, 255, 0.08);
    --card-border: rgba(201, 169, 78, 0.15);
}

@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Outfit:wght@300;400;600;800&display=swap');

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

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(165deg, #0a1628 0%, #0d2847 40%, #0d4f4f 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
    position: relative;
    padding: 2rem 0;
}

/* Islamic Geometric Pattern Overlay */
.islamic-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.04;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(201, 169, 78, 0.5) 40px, rgba(201, 169, 78, 0.5) 41px),
        repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(201, 169, 78, 0.5) 40px, rgba(201, 169, 78, 0.5) 41px),
        repeating-linear-gradient(45deg, transparent, transparent 28px, rgba(201, 169, 78, 0.3) 28px, rgba(201, 169, 78, 0.3) 29px),
        repeating-linear-gradient(-45deg, transparent, transparent 28px, rgba(201, 169, 78, 0.3) 28px, rgba(201, 169, 78, 0.3) 29px);
}

/* Ambient glow elements */
.ambient-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: glowFloat 25s infinite ease-in-out alternate;
}

.glow-1 {
    top: -15%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-teal), transparent);
    animation-delay: 0s;
}

.glow-2 {
    bottom: -15%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(201, 169, 78, 0.4), transparent);
    animation-delay: -8s;
}

.glow-3 {
    top: 50%;
    left: 30%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(26, 107, 74, 0.3), transparent);
    animation-delay: -15s;
}

@keyframes glowFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, -40px) scale(1.15);
    }

    100% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

/* Main Container */
.container {
    width: 100%;
    max-width: 900px;
    padding: 2.5rem;
    margin: 0 1rem;
    border-radius: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    z-index: 1;
}

.glass-panel {
    background: rgba(10, 22, 40, 0.65);
    border: 1px solid rgba(201, 169, 78, 0.12);
    box-shadow:
        0 25px 60px -12px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(201, 169, 78, 0.08);
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
}

.header-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: block;
    filter: drop-shadow(0 0 12px rgba(201, 169, 78, 0.4));
    animation: subtlePulse 4s ease-in-out infinite;
}

@keyframes subtlePulse {

    0%,
    100% {
        opacity: 0.9;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

h1 {
    font-family: 'Amiri', serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold), #f0ece2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

header p {
    color: var(--text-secondary);
    font-size: clamp(0.85rem, 2.5vw, 1.05rem);
    font-weight: 300;
}

/* Ornamental Divider */
.ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
    color: var(--accent-gold);
    opacity: 0.5;
    font-size: 0.7rem;
    letter-spacing: 4px;
}

.ornament::before,
.ornament::after {
    content: '';
    height: 1px;
    width: 60px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    position: relative;
    box-shadow: 0 8px 30px -5px rgba(0, 0, 0, 0.4);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 1.2rem;
    border: 1px solid rgba(201, 169, 78, 0.15);
}

.method-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '▼';
    font-size: 0.7rem;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--accent-gold);
}

#method-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 0.6rem 2.5rem 0.6rem 1.2rem;
    border-radius: 50px;
    background: rgba(201, 169, 78, 0.08);
    border: 1px solid rgba(201, 169, 78, 0.2);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Outfit', sans-serif;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
}

#method-select:hover {
    background: rgba(201, 169, 78, 0.12);
    border-color: rgba(201, 169, 78, 0.35);
}

#method-select:focus {
    background: rgba(201, 169, 78, 0.15);
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 2px rgba(201, 169, 78, 0.2);
}

#method-select option {
    background: var(--bg-color);
    color: var(--text-primary);
}

#city-input {
    flex-grow: 1;
    padding: 1rem 1.5rem;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: background 0.3s;
    min-height: 50px;
}

#city-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#city-input:focus {
    background: rgba(255, 255, 255, 0.1);
}

#search-btn {
    background: linear-gradient(135deg, var(--accent-teal), var(--accent-teal-dark));
    border: none;
    color: white;
    padding: 0 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    min-height: 50px;
}

#search-btn:hover {
    background: linear-gradient(135deg, #1fa08e, var(--accent-teal));
    box-shadow: 0 0 15px rgba(26, 138, 122, 0.3);
}

.error {
    color: #fca5a5;
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    background: rgba(239, 68, 68, 0.1);
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.hidden {
    display: none !important;
}

/* Loading Spinner */
.loading {
    text-align: center;
    margin: 3rem 0;
    animation: fadeIn 0.3s ease;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(201, 169, 78, 0.15);
    border-top: 3px solid var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Results Section */
.results-section {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.results-section.fade-in {
    animation: fadeSlideUp 0.5s ease forwards;
}

.results-section.fade-out {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.location-info {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(201, 169, 78, 0.1);
}

#location-name {
    font-family: 'Amiri', serif;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.coords {
    color: var(--accent-teal);
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
    font-family: monospace;
}

.date-info {
    color: var(--text-secondary);
    font-weight: 300;
    font-size: clamp(0.8rem, 2vw, 0.95rem);
}

/* Prayer Results Layout — side by side on desktop */
.prayer-results-layout {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
}

/* Countdown Timer */
.countdown-container {
    flex-shrink: 0;
    width: 280px;
    padding: 2rem 1.5rem;
    background:
        linear-gradient(145deg, rgba(13, 79, 79, 0.5), rgba(10, 22, 40, 0.8));
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    animation: fadeIn 0.5s ease;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(201, 169, 78, 0.1);
    border: 1px solid rgba(201, 169, 78, 0.15);
    position: relative;
    overflow: hidden;
}

/* Subtle geometric motif on countdown card */
.countdown-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.04;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 15px, rgba(201, 169, 78, 0.5) 15px, rgba(201, 169, 78, 0.5) 16px),
        repeating-linear-gradient(-45deg, transparent, transparent 15px, rgba(201, 169, 78, 0.5) 15px, rgba(201, 169, 78, 0.5) 16px);
    pointer-events: none;
}

.next-prayer-label {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--accent-gold-light);
    margin-bottom: 0.1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.next-prayer-title {
    font-family: 'Amiri', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.8rem;
}

.countdown-timer {
    font-size: clamp(2.2rem, 5vw, 3rem);
    font-weight: 800;
    color: white;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    line-height: 1;
    margin-bottom: 0.6rem;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
}

.next-prayer-time {
    font-size: 1.1rem;
    color: var(--accent-gold);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Prayer Grid */
.prayer-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
    align-content: start;
}

.prayer-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.2rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    min-height: 90px;
}

.prayer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(201, 169, 78, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.prayer-card:hover {
    transform: translateY(-3px);
    background: var(--card-hover);
    box-shadow: 0 8px 20px -5px rgba(0, 0, 0, 0.4);
    border-color: rgba(201, 169, 78, 0.3);
}

.prayer-card:hover::before {
    opacity: 1;
}

.prayer-card.current {
    background: rgba(26, 138, 122, 0.12);
    border-color: var(--accent-teal);
    box-shadow: 0 0 20px rgba(26, 138, 122, 0.2);
}

.prayer-name {
    font-family: 'Amiri', serif;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.prayer-card.current .prayer-name {
    color: var(--accent-gold);
}

.prayer-time {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 800;
    color: var(--text-primary);
}

/* Footer Bismillah */
.bismillah {
    text-align: center;
    margin-top: 2rem;
    font-family: 'Amiri', serif;
    font-size: 1.3rem;
    color: var(--accent-gold);
    opacity: 0.4;
    letter-spacing: 1px;
}

/* =================== */
/* RESPONSIVE DESIGN   */
/* =================== */

/* Tablets */
@media (max-width: 768px) {
    body {
        align-items: flex-start;
        padding: 1rem 0;
    }

    .container {
        padding: 1.5rem;
        margin: 0 0.75rem;
        border-radius: 20px;
    }

    h1 {
        font-size: clamp(1.8rem, 5vw, 2.4rem);
    }

    .prayer-results-layout {
        flex-direction: column;
    }

    .countdown-container {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        padding: 1.5rem;
    }

    .next-prayer-label {
        width: 100%;
        text-align: center;
        font-size: 0.8rem;
    }

    .next-prayer-title {
        margin-bottom: 0;
        margin-right: 1rem;
    }

    .countdown-timer {
        font-size: 2.5rem;
        margin-bottom: 0;
    }

    .next-prayer-time {
        width: 100%;
        text-align: center;
    }

    .prayer-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile */
@media (max-width: 480px) {
    body {
        padding: 0.5rem 0;
    }

    .container {
        padding: 1.25rem;
        margin: 0 0.5rem;
        border-radius: 16px;
    }

    header {
        margin-bottom: 1.5rem;
    }

    .header-icon {
        font-size: 2rem;
    }

    .method-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    #method-select {
        width: 100%;
        font-size: 0.85rem;
    }

    .input-group {
        margin-bottom: 1rem;
    }

    #city-input {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
        min-height: 48px;
    }

    .ornament {
        margin: 1rem 0;
    }

    .ornament::before,
    .ornament::after {
        width: 40px;
    }

    .location-info {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .countdown-container {
        padding: 1.25rem;
        border-radius: 16px;
    }

    .countdown-timer {
        font-size: 2.2rem;
    }

    .prayer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .prayer-card {
        padding: 1rem 0.75rem;
        border-radius: 12px;
        min-height: 80px;
    }

    .prayer-name {
        font-size: 0.9rem;
    }

    .prayer-time {
        font-size: 1.15rem;
    }

    .bismillah {
        font-size: 1.1rem;
        margin-top: 1.5rem;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .container {
        padding: 1rem;
        margin: 0 0.25rem;
    }

    .prayer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .countdown-timer {
        font-size: 2rem;
    }
}