@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffffff;
    font-family: 'Cairo', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    background: linear-gradient(90deg, rgba(38, 50, 56, 0.1), rgba(26, 35, 126, 0.1));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid rgba(38, 50, 56, 0.3);
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #263238 0%, #1A237E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

header h1 i {
    font-size: 2rem;
}

header a {
    font-size: 1.5rem;
    color: #263238;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
}

header a:hover {
    color: #fff;
    background: rgba(38, 50, 56, 0.3);
    transform: scale(1.1);
}

header a:active {
    transform: scale(0.95);
}
    
header a {
    font-size: 1.5rem;
    color: #263238;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

header a:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

header a:active {
    transform: scale(0.95) rotate(0deg);
}

/* ============================================
   Main Content
   ============================================ */
main {
    flex: 1;
    padding: 2rem 1rem;
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ============================================
   Card Styles - اذكار النوم (لون أزرق داكن/رمادي)
   ============================================ */
.card {
    background: linear-gradient(135deg, #1e1e1e, #2d3436);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    border: 2px solid rgba(38, 50, 56, 0.3);
    width: 100%;
    min-height: 300px;
    position: relative;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.card.transitioning {
    opacity: 0.5;
    transform: scale(0.95);
}

.zekr-container {
    padding: 3rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(38, 50, 56, 0.15) 0%, rgba(26, 35, 126, 0.15) 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    min-height: 300px;
}

.zekr-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.card:hover .zekr-container::before {
    left: 100%;
}

/* ============================================
   رقم الذكر (1/16, 2/16, إلخ)
   ============================================ */
.zekr-number {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ============================================
   نص الذكر
   ============================================ */
.zekr-text {
    font-size: 2rem;
    font-weight: 700;
    color: #90A4AE;
    margin: 0;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(38, 50, 56, 0.3);
    line-height: 1.6;
    transition: all 0.3s ease;
    word-wrap: break-word;
    max-width: 100%;
    font-stretch: normal;
    text-rendering: optimizeLegibility;
    -webkit-font-feature-settings: normal;
    font-feature-settings: normal;
    letter-spacing: normal;
    word-spacing: normal;
}

/* ============================================
   زر العداد
   ============================================ */
.counter-btn {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(38, 50, 56, 0.9) 0%, rgba(26, 35, 126, 0.9) 100%);
    border: none;
    border-radius: 16px;
    padding: 1.2rem 2.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(38, 50, 56, 0.4);
    position: relative;
    z-index: 2;
    min-width: 120px;
    font-family: 'Cairo', sans-serif;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.counter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(38, 50, 56, 0.5);
}

.counter-btn:active,
.counter-btn.pressed {
    transform: scale(0.95) translateY(0);
    box-shadow: 0 2px 10px rgba(38, 50, 56, 0.3);
}

.counter-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.counter-btn.completed {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.9) 0%, rgba(56, 142, 60, 0.9) 100%);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

/* ============================================
   Responsive Design - Mobile First
   ============================================ */
@media (max-width: 480px) {
    header {
        padding: 1rem 1.2rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    header a {
        font-size: 1.3rem;
        width: 2.2rem;
        height: 2.2rem;
    }
    
    main {
        padding: 1.5rem 0.8rem;
    }
    
    .card {
        border-radius: 20px;
        min-height: 250px;
    }
    
    .zekr-container {
        padding: 2rem 1.5rem;
        gap: 2rem;
        min-height: 250px;
    }
    
    .zekr-text {
        font-size: 1.5rem;
    }
    
    .counter-btn {
        font-size: 1.3rem;
        padding: 1rem 2rem;
        min-width: 100px;
    }
}

@media (max-width: 360px) {
    header h1 {
        font-size: 1.3rem;
    }
    
    .zekr-text {
        font-size: 1.3rem;
    }
    
    .counter-btn {
        font-size: 1.2rem;
        padding: 0.9rem 1.8rem;
    }
    
    .zekr-container {
        padding: 1.5rem 1rem;
        gap: 1.5rem;
    }
}

/* ============================================
   Landscape Orientation
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    header {
        padding: 0.8rem 1.2rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .zekr-container {
        padding: 1.5rem 1rem;
        gap: 1.5rem;
        min-height: 200px;
    }
    
    .zekr-text {
        font-size: 1.5rem;
    }
}

/* ============================================
   Animation for page load
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.5s ease forwards;
}

/* ============================================
   Touch-friendly improvements
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .counter-btn:hover {
        transform: none;
    }
    
    .counter-btn:active {
        transform: scale(0.95);
    }
}

/* ============================================
   Safe Area for Notched Devices
   ============================================ */
@supports (padding: max(0px)) {
    header {
        padding-left: max(1.2rem, env(safe-area-inset-left));
        padding-right: max(1.2rem, env(safe-area-inset-right));
        padding-top: max(1.2rem, env(safe-area-inset-top));
    }
    
    main {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
}

/* ============================================
   Reduced motion support
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

