/* ============================================
   QIBLA SECTION STYLES
   ============================================ */

/* Main Section */
.qibla-section {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 70px;
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8ff 50%, #e8f0ff 100%);
    z-index: 50;
    overflow-y: auto;
    padding: 85px 20px 110px;
}

/* ============================================
   HEADER
   ============================================ */

.qibla-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 0;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(45, 80, 22, 0.1);
    position: fixed;
    top: 85px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 428px;
    z-index: 90;
}

.qibla-section-title-wrapper {
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    pointer-events: none;
}

.qibla-section-title-wrapper h2 {
    font-size: 24px;
    font-weight: bold;
    color: #2d5016;
    margin: 0;
    pointer-events: auto;
}

.qibla-section .back-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.qibla-section .back-btn:hover {
    background: rgba(76, 175, 80, 0.2);
    transform: scale(1.1);
}

/* ============================================
   COMPASS CONTAINER
   ============================================ */

.compass-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 40px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 428px;
    margin: 0 auto 8px auto;
    display: flex;
    justify-content: center;
}

.compass-wrapper {
    position: relative;
    width: 400px;
    height: 400px;
    max-width: 90vw;
    max-height: 90vw;
}

/* ============================================
   TURN INDICATORS
   ============================================ */

.turn-indicator {
    position: absolute;
    top: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #FF5722, #F44336);
    color: white;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 16px rgba(255, 87, 34, 0.4);
    z-index: 25;
    animation: blink-indicator 1s ease-in-out infinite;
}

.turn-indicator.turn-left {
    left: 0px;
}

.turn-indicator.turn-right {
    right: 0px;
}

.turn-indicator i {
    font-size: 20px;
}

@keyframes blink-indicator {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* ============================================
   ZOOM BUTTONS
   ============================================ */

.compass-zoom-btn {
    position: absolute;
    bottom: -18px;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 20;
    color: white;
}

.compass-zoom-btn.zoom-left {
    left: -18px;
    background: linear-gradient(135deg, #FF9800, #F57C00);
}

.compass-zoom-btn.zoom-right {
    right: -18px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.compass-zoom-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.compass-zoom-btn:active {
    transform: scale(0.95);
}

/* ============================================
   MAP LAYER
   ============================================ */

.qibla-map-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

/* ============================================
   COMPASS CIRCLE
   ============================================ */

.compass-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 8px solid #4CAF50;
    pointer-events: none;
    z-index: 10;
}

/* ============================================
   CARDINAL MARKERS
   ============================================ */

.qibla-section .cardinal-marker {
    position: absolute;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.qibla-section .cardinal-marker.north {
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f44336, #c62828);
}

.qibla-section .cardinal-marker.east {
    right: -18px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #2196F3, #1565C0);
}

.qibla-section .cardinal-marker.south {
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #9E9E9E, #616161);
}

.qibla-section .cardinal-marker.west {
    left: -18px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #FF9800, #F57C00);
}

/* ============================================
   DEGREE MARKERS
   ============================================ */

.degree-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.qibla-section .degree-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160px;
    height: 1px;
    transform-origin: 0 0;
    font-size: 13px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 15px;
}

/* ============================================
   COMPASS CENTER
   ============================================ */

.compass-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #333;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 15;
}

/* ============================================
   QIBLA LINE & ICON
   ============================================ */

.qibla-line-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 12;
}

.qibla-icon-label {
    position: absolute;
    transform: translate(-50%, -50%);
    background: #4CAF50;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 13;
}

.qibla-icon-label i {
    font-size: 14px;
}

/* ============================================
   DEVICE TRIANGLE (Blue Arrow)
   ============================================ */

.device-triangle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform-origin: 50% 100%;
    transition: transform 0.3s ease-out;
    z-index: 14;
}

.triangle-pointer {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 100px solid #2196F3;
    position: absolute;
    left: -10px;
    bottom: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: border-bottom-color 0.3s ease;
}

.device-triangle.aligned .triangle-pointer {
    border-bottom-color: #4CAF50;
}

/* ============================================
   MAP MARKERS
   ============================================ */

.qibla-user-marker .marker-inner {
    width: 20px;
    height: 20px;
    background: #2196F3;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.qibla-kaaba-marker .marker-inner {
    width: 30px;
    height: 30px;
    background: #4CAF50;
    color: white;
    border: 3px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-size: 14px;
}

/* ============================================
   LOCATION PANEL
   ============================================ */

.location-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 428px;
    margin: 0 auto 8px auto;
}

/* Current Location Display */
.current-location-display {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e0e0e0;
}

.location-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.location-details {
    flex: 1;
}

.location-name {
    font-size: 16px;
    font-weight: 600;
    color: #2d5016;
    margin-bottom: 4px;
}

.location-coords {
    font-size: 12px;
    color: #666;
    font-family: monospace;
}

/* Location Search */
.location-search {
    margin-bottom: 16px;
}

.search-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #2d5016;
    margin-bottom: 8px;
}

.search-input-container {
    display: flex;
    gap: 8px;
}

.qibla-section .search-input-container input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    touch-action: manipulation;
}

.qibla-section .search-input-container input:focus {
    outline: none;
    border-color: #4CAF50;
}

.qibla-section .search-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Qibla Info Inline */
.qibla-info-inline {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

.info-item i {
    color: #4CAF50;
}

/* Location Actions */
.location-actions {
    display: flex;
    gap: 12px;
}

.location-action-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.location-action-btn.gps-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

/* ============================================
   DARK MODE
   ============================================ */

.dark-mode .qibla-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d3748 50%, #1a202c 100%);
}

.dark-mode .qibla-section-header {
    background: rgba(30, 30, 30, 0.98);
    border-color: rgba(76, 175, 80, 0.3);
}

.dark-mode .qibla-section-title-wrapper h2 {
    color: #4CAF50;
}

.dark-mode .compass-container {
    background: rgba(45, 45, 45, 0.95);
}

.dark-mode .compass-center {
    background: white;
    border-color: #333;
}

.dark-mode .qibla-icon-label {
    background: #45a049;
}

.dark-mode .location-panel {
    background: rgba(45, 45, 45, 0.95);
}

.dark-mode .current-location-display {
    border-bottom-color: #444;
}

.dark-mode .location-name {
    color: #4CAF50;
}

.dark-mode .location-coords {
    color: #999;
}

.dark-mode .search-label {
    color: #4CAF50;
}

.dark-mode .qibla-section .search-input-container input {
    background: rgba(30, 30, 30, 0.9);
    border-color: #444;
    color: white;
}

.dark-mode .qibla-info-inline {
    background: rgba(255, 255, 255, 0.05);
}

.dark-mode .info-item {
    color: #999;
}

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

@media (max-width: 480px) {
    .compass-wrapper {
        width: 320px;
        height: 320px;
    }

    .compass-zoom-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .location-actions {
        flex-direction: column;
    }
}
