/* ============================================================
   Islamic Tools - Complete Stylesheet
   ============================================================ */

/* === General === */
:root {
    --it-primary: #1a6b3c;
    --it-primary-dark: #124d2c;
    --it-secondary: #c8a84e;
    --it-secondary-dark: #a88a3a;
    --it-bg: #f5f0e8;
    --it-card-bg: #ffffff;
    --it-text: #2c2c2c;
    --it-text-light: #666666;
    --it-border: #e0d5c0;
    --it-shadow: 0 4px 20px rgba(0,0,0,0.08);
    --it-radius: 16px;
    --it-gradient: linear-gradient(135deg, #1a6b3c 0%, #2d9b5e 100%);
}

.it-card {
    background: var(--it-card-bg);
    border-radius: var(--it-radius);
    box-shadow: var(--it-shadow);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--it-border);
}

.it-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
}

.it-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.it-btn:active {
    transform: translateY(0);
}

.it-btn-primary {
    background: var(--it-gradient);
    color: white;
}

.it-btn-primary:hover {
    background: linear-gradient(135deg, #124d2c 0%, #1a6b3c 100%);
}

.it-btn-secondary {
    background: var(--it-secondary);
    color: white;
}

.it-btn-secondary:hover {
    background: var(--it-secondary-dark);
}

.it-error {
    color: #d32f2f;
    background: #fde8e8;
    padding: 10px 16px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 14px;
}

.it-icon {
    font-size: 24px;
    margin-right: 8px;
}

/* Location Input */
.it-location-input {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--it-bg);
    border-radius: 12px;
}

.it-location-input label {
    font-size: 13px;
    font-weight: 600;
    color: var(--it-text-light);
}

.it-location-input input {
    width: 100px;
    padding: 8px 12px;
    border: 1px solid var(--it-border);
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.it-location-input input:focus {
    outline: none;
    border-color: var(--it-primary);
    box-shadow: 0 0 0 2px rgba(26, 107, 60, 0.15);
}

/* ============================================================
   PRAYER TIMES
   ============================================================ */
.it-prayer-header {
    background: var(--it-gradient);
    color: white;
    text-align: center;
}

.it-prayer-header h2 {
    margin: 0;
    font-size: 24px;
    color: white;
}

.it-prayer-date {
    margin-top: 8px;
    font-size: 14px;
    opacity: 0.9;
}

.it-prayer-times-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.it-prayer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: var(--it-bg);
    border-radius: 12px;
    border: 1px solid var(--it-border);
    transition: all 0.3s ease;
}

.it-prayer-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.it-prayer-item.current-prayer {
    background: linear-gradient(135deg, #1a6b3c 0%, #2d9b5e 100%);
    color: white;
    border-color: var(--it-primary);
}

.it-prayer-item.current-prayer .it-prayer-name,
.it-prayer-item.current-prayer .it-prayer-time {
    color: white;
}

.it-prayer-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--it-text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.it-prayer-time {
    font-size: 20px;
    font-weight: 700;
    color: var(--it-text);
    margin-top: 6px;
}

.it-next-prayer {
    text-align: center;
    padding: 20px;
    background: var(--it-gradient);
    border-radius: 12px;
    color: white;
    margin-top: 16px;
}

.it-next-prayer-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.9;
}

.it-next-prayer-name {
    font-size: 28px;
    font-weight: 700;
    margin: 8px 0;
}

.it-next-prayer-countdown {
    font-size: 36px;
    font-weight: 300;
    font-family: 'Courier New', monospace;
    letter-spacing: 4px;
}

/* ============================================================
   DHIKR COUNTER
   ============================================================ */
.it-dhikr-header {
    background: var(--it-gradient);
    color: white;
    text-align: center;
    position: relative;
}

.it-dhikr-header h2 {
    margin: 0;
    font-size: 24px;
    color: white;
}

.it-dhikr-total {
    margin-top: 12px;
    font-size: 14px;
    opacity: 0.9;
}

.it-total-count {
    font-size: 28px;
    font-weight: 700;
    display: block;
    margin-top: 4px;
}

.it-dhikr-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.it-dhikr-preset {
    text-align: center;
    padding: 20px 16px;
    background: var(--it-bg);
    border-radius: 12px;
    border: 1px solid var(--it-border);
    transition: all 0.3s ease;
}

.it-dhikr-preset:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.it-dhikr-preset-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--it-text);
    margin-bottom: 4px;
}

.it-dhikr-preset-target {
    font-size: 13px;
    color: var(--it-text-light);
    margin-bottom: 12px;
}

.it-btn-dhikr {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--it-gradient);
    color: white;
    font-size: 16px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 4px 12px rgba(26, 107, 60, 0.3);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.it-btn-dhikr:active {
    transform: scale(0.90);
    box-shadow: 0 2px 6px rgba(26, 107, 60, 0.2);
}

.it-btn-dhikr.dhikr-haptic {
    animation: dhikr-pulse 0.15s ease-in-out;
}

@keyframes dhikr-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.92); box-shadow: 0 0 0 8px rgba(26, 107, 60, 0.15); }
    100% { transform: scale(1); }
}

.it-dhikr-preset-count {
    font-size: 32px;
    font-weight: 700;
    color: var(--it-primary);
    margin: 8px 0;
}

.it-dhikr-progress {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.it-dhikr-progress-bar {
    height: 100%;
    background: var(--it-gradient);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Custom Dhikr */
.it-dhikr-custom {
    margin-top: 20px;
    padding: 16px;
    background: var(--it-bg);
    border-radius: 12px;
}

.it-dhikr-custom h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: var(--it-text);
}

.it-dhikr-custom-input {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.it-dhikr-custom-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--it-border);
    border-radius: 8px;
    font-size: 14px;
}

.it-custom-dhikr-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--it-border);
}

.it-custom-dhikr-item .dhikr-custom-name {
    font-weight: 600;
    color: var(--it-text);
}

.it-custom-dhikr-item .dhikr-custom-count {
    font-size: 20px;
    font-weight: 700;
    color: var(--it-primary);
}

.it-custom-dhikr-item .dhikr-custom-tap {
    background: var(--it-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.1s ease;
}

.it-custom-dhikr-item .dhikr-custom-tap:active {
    transform: scale(0.88);
}

.it-dhikr-save {
    text-align: center;
    margin-top: 16px;
}

.it-save-message {
    display: inline-block;
    margin-left: 10px;
    font-size: 14px;
    color: var(--it-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.it-save-message.show {
    opacity: 1;
}

/* ============================================================
   QIBLA COMPASS
   ============================================================ */
.it-qibla-header {
    background: var(--it-gradient);
    color: white;
    text-align: center;
}

.it-qibla-header h2 {
    margin: 0;
    font-size: 24px;
    color: white;
}

.it-compass-container {
    position: relative;
    margin: 20px auto;
    max-width: 320px;
}

.it-compass-rose {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto;
    background: radial-gradient(circle, #f5f0e8 0%, #e8dcc8 100%);
    border-radius: 50%;
    border: 4px solid var(--it-secondary);
    box-shadow: 0 0 0 8px rgba(200, 168, 78, 0.2), var(--it-shadow);
    transition: transform 0.5s ease;
}

.it-compass-rose div[class^="it-compass-"]:not(.it-compass-arrow):not(.it-compass-marker) {
    position: absolute;
    font-weight: 700;
    font-size: 14px;
    color: var(--it-text-light);
}

.it-compass-n {
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    color: #c62828 !important;
    font-size: 18px !important;
}

.it-compass-s {
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.it-compass-e {
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.it-compass-w {
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.it-compass-ne {
    top: 30px;
    right: 30px;
}

.it-compass-nw {
    top: 30px;
    left: 30px;
}

.it-compass-se {
    bottom: 30px;
    right: 30px;
}

.it-compass-sw {
    bottom: 30px;
    left: 30px;
}

/* Tick marks around compass */
.it-compass-rose::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 2px solid var(--it-border);
    border-radius: 50%;
}

.it-compass-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    font-size: 32px;
    transition: transform 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.it-qibla-marker {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 28px;
    z-index: 3;
    transition: transform 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom center;
}

.it-qibla-info {
    text-align: center;
    margin-top: 16px;
}

.it-qibla-angle {
    font-size: 18px;
    font-weight: 700;
    color: var(--it-text);
}

.it-qibla-angle span {
    color: var(--it-primary);
}

.it-compass-status {
    font-size: 13px;
    color: var(--it-text-light);
    margin-top: 6px;
}

.it-qibla-static {
    text-align: center;
    padding: 20px;
}

.it-qibla-static-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--it-text);
    background: var(--it-bg);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--it-border);
}

.it-qibla-static-text strong {
    color: var(--it-primary);
    font-size: 28px;
}

/* ============================================================
   DAILY VERSE
   ============================================================ */
.it-verse-card {
    text-align: center;
    padding: 40px 30px;
    background: var(--it-gradient);
    color: white;
    position: relative;
    overflow: hidden;
}

.it-verse-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.05) 0%, transparent 60%);
    pointer-events: none;
}

.it-verse-icon {
    font-size: 36px;
    opacity: 0.6;
    margin-bottom: 16px;
    font-family: 'Traditional Arabic', 'Scheherazade New', serif;
}

.it-verse-arabic {
    font-size: 32px;
    line-height: 1.8;
    font-family: 'Traditional Arabic', 'Scheherazade New', 'Amiri', 'Noto Naskh Arabic', serif;
    direction: rtl;
    margin-bottom: 20px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.it-verse-translation {
    font-size: 18px;
    line-height: 1.6;
    opacity: 0.95;
    margin-bottom: 16px;
    font-style: italic;
}

.it-verse-reference {
    font-size: 14px;
    opacity: 0.75;
    font-weight: 600;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .it-verse-arabic {
        font-size: 24px;
    }

    .it-prayer-times-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }

    .it-dhikr-presets {
        grid-template-columns: 1fr;
    }

    .it-compass-rose {
        width: 220px;
        height: 220px;
    }

    .it-location-input {
        flex-direction: column;
        align-items: stretch;
    }

    .it-location-input input {
        width: auto;
    }

    .it-next-prayer-countdown {
        font-size: 28px;
    }
}
