/* 
======================================
    GLOBAL RESET / BASE STYLES
======================================
*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #14b8a6;
    --secondary-color: #d97706;
    --accent-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --bg-gradient: linear-gradient(135deg, #0d9488 0%, #059669 50%, #047857 100%);
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    font-size: clamp(16px, 1vw, 18px);
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #d1fae5 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html,
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/*
======================================
    HERO SECTION
======================================
*/
.hero-section {
    position: relative;
    background: var(--bg-gradient);
    padding: 60px 20px;
    text-align: center;
    color: white;
    overflow: hidden;
    margin-bottom: 30px;
}

.hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.title-main {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.title-arabic {
    font-size: clamp(1.3rem, 3vw, 2rem);
    font-weight: 400;
    opacity: 0.95;
    font-family: 'Amiri', 'Arial', sans-serif;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    opacity: 0.95;
    font-weight: 300;
}

/*
======================================
    GLOBAL CONTAINER
======================================
*/
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 40px;
    position: relative;
}

/*
======================================
    CARD COMPONENTS
======================================
*/
.card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    padding: 20px 24px;
    border-bottom: 2px solid #d1fae5;
}

.card-header h2 {
    margin: 0;
    font-size: clamp(1.3rem, 2vw, 1.5rem);
    font-weight: 600;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header i {
    color: var(--primary-color);
}

.card-body {
    padding: 24px;
}

/*
======================================
    SETTINGS CONTAINER (Side by Side)
======================================
*/
.settings-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

/*
======================================
    LOCATION SECTION
======================================
*/
.location-section .location-guide {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    border-left: 4px solid var(--accent-color);
}

.location-guide h3 {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.location-guide p {
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.guide-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guide-item {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.location-input-overview {
    display: none;
    margin-bottom: 24px;
}

/*
======================================
    FORM ELEMENTS
======================================
*/
.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

label i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

input,
select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    font-size: 1rem;
    background-color: #ffffff;
    transition: var(--transition);
    font-family: inherit;
}

input:focus,
select:focus {
    border-color: var(--primary-color);
    background-color: #ffffff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

input::placeholder {
    color: #9ca3af;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230d9488' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.custom-params {
    background: #f9fafb;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    border: 2px dashed #d1d5db;
}

.custom-params h3 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

/*
======================================
    BUTTONS
======================================
*/
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    margin: 10px 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--bg-gradient);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    font-family: inherit;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.load-prayer-btn {
    background: var(--bg-gradient);
    font-size: 1.15rem;
    padding: 18px 32px;
    margin: 24px 0;
    box-shadow: 0 6px 12px -2px rgba(13, 148, 136, 0.3);
}

.load-prayer-btn:hover {
    box-shadow: 0 12px 20px -4px rgba(13, 148, 136, 0.4);
}

.sms-alert-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 32px;
    margin: 16px 0 24px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 6px 12px -2px rgba(139, 92, 246, 0.3);
    transition: var(--transition);
    width: 100%;
    max-width: 500px;
}

.sms-alert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -4px rgba(139, 92, 246, 0.4);
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 50%, #5b21b6 100%);
}

.sms-alert-btn:active {
    transform: translateY(0);
}

.get-location-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    margin-bottom: 16px;
}

.get-location-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.sms-alert-btn-fixed {
    position: fixed;
    top: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    transition: var(--transition);
    white-space: nowrap;
}

.sms-alert-btn-fixed:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 50%, #5b21b6 100%);
}

.sms-alert-btn-fixed:active {
    transform: translateY(0);
}

/*
======================================
    ALERT & STATUS
======================================
*/
.alert-container {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.alert-msg {
    color: #dc2626;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fef2f2;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

.location-status {
    margin: 16px 0;
    padding: 12px;
    text-align: center;
    font-size: 0.95rem;
    min-height: 20px;
    border-radius: 8px;
}

/*
======================================
    QIBLA & MOON CONTAINER
======================================
*/
.qibla-moon-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

/*
======================================
    QIBLA COMPASS
======================================
*/
.qibla-section {
    text-align: center;
}

#qibla-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#qibla-compass {
    position: relative;
    width: 220px;
    height: 220px;
    border: 4px solid var(--primary-color);
    border-radius: 50%;
    margin: 20px auto;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.compass-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 3px solid white;
    z-index: 10;
}

#qibla-needle {
    position: absolute;
    width: 4px;
    height: 45%;
    background: linear-gradient(180deg, #dc2626 0%, var(--primary-color) 100%);
    top: 50%;
    left: 50%;
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(0deg);
    border-radius: 4px 4px 0 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.5s ease-out;
    z-index: 5;
}

.compass-label {
    position: absolute;
    font-weight: 700;
    font-size: 16px;
    color: var(--primary-dark);
    background: white;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.north {
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.east {
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
}

.south {
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.west {
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
}

.qibla-direction-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-dark);
    padding: 12px 24px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: 12px;
    border: 2px solid var(--primary-color);
}

/*
======================================
    MOON PHASE DISPLAY
======================================
*/
.moon-section {
    text-align: center;
}

#moon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#moon-phase-display {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#moon-emoji-display {
    font-size: clamp(180px, 15vw, 220px);
    line-height: 1;
    transition: transform 0.3s ease;
}

#moon-emoji-display:hover {
    transform: scale(1.1);
}

.moon-info-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 1rem;
}

#moon-phase-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-dark);
    padding: 12px 24px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    border: 2px solid var(--accent-color);
}

#moon-illumination {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.moon-times {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.moon-times div {
    padding: 4px 0;
}

/*
======================================
    MOON DIRECTION COMPASS
======================================
*/
.moon-direction-section {
    text-align: center;
}

#moon-direction-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#moon-direction-compass {
    position: relative;
    width: 220px;
    height: 220px;
    border: 4px solid var(--secondary-color);
    border-radius: 50%;
    margin: 20px auto;
    background: linear-gradient(135deg, #ffffff 0%, #fff8e1 100%);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

#moon-direction-needle {
    position: absolute;
    width: 4px;
    height: 45%;
    background: linear-gradient(180deg, #ff9800 0%, var(--secondary-color) 100%);
    top: 50%;
    left: 50%;
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(0deg);
    border-radius: 4px 4px 0 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.5s ease-out;
    z-index: 5;
}

.moon-direction-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 12px 24px;
    background: linear-gradient(135deg, #fff8e1 0%, #ffe082 100%);
    border-radius: 12px;
    border: 2px solid var(--secondary-color);
    text-align: center;
}

.moon-altitude-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 16px;
    background: #f9fafb;
    border-radius: 8px;
    text-align: center;
}

/*
======================================
    WORLD MAP
======================================
*/
.world-map-container {
    width: 100%;
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.legend-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.kaaba-icon {
    color: #d97706;
    font-size: 18px;
}

.sun-icon {
    font-size: 20px;
    display: inline-block;
    line-height: 1;
}

.moon-icon {
    font-size: 20px;
    display: inline-block;
    line-height: 1;
}

.user-icon {
    color: #3b82f6;
    font-size: 18px;
}

.terminator-icon {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.5) 100%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

/* Terminator gradient styling - smooth, subtle transition */
.terminator-gradient-layer {
    filter: blur(1.5px);
    transition: opacity 0.3s ease;
}

/* Smooth gradient effect for terminator layers */
.leaflet-pane svg path.terminator-gradient-layer {
    mix-blend-mode: normal;
    opacity: 1;
}

/* Leaflet marker styles */
.kaaba-marker,
.moon-marker {
    background: transparent;
    border: none;
}

/*
======================================
    PRAYER TIMES
======================================
*/
.prayer-section {
    margin-top: 24px;
}

#prayercityname {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 600;
    color: var(--primary-dark);
    margin: 0;
}

#location-date {
    font-size: clamp(0.85rem, 1.5vw, 0.9rem);
    font-weight: 400;
    opacity: 0.8;
    margin-top: 4px;
}

.local-time-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: clamp(1rem, 1.5vw, 1.1rem);
    font-weight: 500;
    color: var(--primary-dark);
    white-space: nowrap;
    flex-wrap: wrap;
}

.local-time-display i {
    font-size: 1rem;
    color: var(--primary-color);
}

#localTimeText {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .card-header > div {
        flex-direction: column;
        text-align: center;
        align-items: center !important;
    }
    
    #prayercityname {
        text-align: center;
        width: 100%;
    }

    #location-date {
        text-align: center;
    }
    
    .local-time-display {
        font-size: 1rem;
        justify-content: center;
    }
}

.prayer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    width: 100%;
    margin-top: 20px;
}

.prayer-time {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    padding: 24px 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--card-shadow);
    border: 2px solid #d1fae5;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.prayer-time::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--bg-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.prayer-time:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary-color);
}

.prayer-time:hover::before {
    transform: scaleX(1);
}

.prayer-time.next-prayer-active {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 3px solid var(--accent-color);
    box-shadow: 0 8px 16px rgba(217, 119, 6, 0.3);
    transform: translateY(-4px) scale(1.02);
}

.prayer-time.next-prayer-active::before {
    transform: scaleX(1);
    background: var(--bg-gradient);
    height: 5px;
}

.prayer-time.next-prayer-active .prayer-name {
    color: var(--primary-dark);
}

.prayer-time.next-prayer-active .prayer-time-text {
    color: var(--primary-dark);
    font-weight: 700;
}

.prayer-name {
    margin: 0 0 12px 0;
    font-size: clamp(1.2rem, 2vw, 1.4rem);
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prayer-name-ar {
    font-size: clamp(1rem, 1.5vw, 1.1rem);
    color: var(--text-secondary);
    font-weight: 500;
    direction: rtl;
    font-family: 'Amiri', 'Arial', sans-serif;
}

.prayer-time-text {
    margin: 0;
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.next-prayer {
    margin: 0 auto 24px auto;
    padding: 24px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.next-prayer-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.next-prayer-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.next-prayer-name {
    font-size: clamp(1.2rem, 2vw, 1.4rem);
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.next-prayer-name .prayer-name-ar {
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    color: var(--primary-dark);
    font-family: 'Amiri', 'Arial', sans-serif;
    direction: rtl;
}

.next-prayer-countdown {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--primary-dark);
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    margin-top: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/*
======================================
    WEATHER SECTION
======================================
*/
.weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.loading-text {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.weather-item {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--card-shadow);
    border: 2px solid #e5e7eb;
    transition: var(--transition);
}

.weather-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary-color);
}

.weather-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    display: block;
}

.weather-alerts-wrapper {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 16px;
}

.weather-alert {
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--card-shadow);
}

.weather-alert.no-alert {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 2px solid #10b981;
    color: #065f46;
}

.weather-alert.has-alert {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 2px solid #ef4444;
    color: #991b1b;
}

.normal {
    color: #10b981;
    font-weight: 600;
}

.alert {
    color: #f59e0b;
    font-weight: 600;
}

.danger {
    color: #ef4444;
    font-weight: 600;
}

.tooltip {
    position: relative;
    cursor: help;
}

.tooltip-text {
    visibility: hidden;
    width: 250px;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 0.9rem;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
}

/*
======================================
    FOOTER
======================================
*/
.footer {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: #9ca3af;
    padding: 30px 20px;
    margin-top: 60px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content p {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.footer-license {
    font-size: 0.85rem;
    opacity: 0.8;
}

.footer a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/*
======================================
    VISIBILITY HELPERS
======================================
*/
.hidden {
    display: none;
}

.visible {
    display: block;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

/*
======================================
    ANIMATIONS
======================================
*/
@keyframes breathing {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

/*
======================================
    RESPONSIVE DESIGN
======================================
*/
@media (max-width: 768px) {
    .title-main {
        font-size: 2.5rem;
    }

    .title-arabic {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-section {
        padding: 40px 20px;
    }

    .container {
        padding: 0 16px 30px;
    }

    .card-header h2 {
        font-size: 1.3rem;
    }

    .card-body {
        padding: 20px;
    }

    .settings-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .prayer-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .weather-grid {
        grid-template-columns: 1fr;
    }

    .sms-alert-btn-fixed {
        top: 10px;
        right: 10px;
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .qibla-moon-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    #qibla-compass {
        width: 180px;
        height: 180px;
    }

    #moon-phase-display {
        width: 180px;
        height: 180px;
    }

    #moon-emoji-display {
        font-size: 180px;
    }

    #moon-direction-compass {
        width: 180px;
        height: 180px;
    }

    .world-map-container {
        height: 400px;
    }

    .map-legend {
        flex-direction: column;
        gap: 12px;
    }

    .prayer-name {
        font-size: 1.2rem;
    }

    .prayer-time-text {
        font-size: 1.1rem;
    }

    .next-prayer-name {
        font-size: 1.2rem;
    }

    .next-prayer-countdown {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }
}

@media (max-width: 480px) {
    .title-main {
        font-size: 2rem;
    }

    .title-arabic {
        font-size: 1.3rem;
    }

    input,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    button {
        font-size: 1rem;
        padding: 14px 24px;
    }

    .load-prayer-btn {
        font-size: 1.05rem;
    }

    .sms-alert-btn {
        font-size: 1rem;
        padding: 16px 24px;
    }
}

/*
======================================
    LARGE SCREEN OPTIMIZATION
    (1920px and above, up to 4K)
======================================
*/
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
        padding: 0 40px 60px;
    }

    .hero-section {
        padding: 80px 40px;
    }

    .hero-content {
        max-width: 1000px;
    }

    .card {
        margin-bottom: 32px;
    }

    .card-body {
        padding: 32px;
    }

    .card-header {
        padding: 24px 32px;
    }

    .settings-container {
        gap: 32px;
        margin-bottom: 32px;
    }

    .qibla-moon-container {
        gap: 32px;
    }

    /* Prevent elements from getting too large */
    #qibla-compass,
    #moon-phase-display,
    #moon-direction-compass {
        max-width: 250px;
        max-height: 250px;
    }

    .world-map-container {
        max-height: 600px;
    }
}

/* 4K and ultra-wide screens */
@media (min-width: 2560px) {
    .container {
        max-width: 1800px;
    }

    /* Ensure text doesn't get too large */
    body {
        font-size: clamp(16px, 1.1vw, 18px);
    }

    .card-header h2 {
        font-size: clamp(1.5rem, 1.8vw, 1.75rem);
    }
}
