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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.location-info, .search-form, .prayer-times, .qibla-compass {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.location-card, .error-card {
    padding: 15px;
    border-radius: 10px;
}

.location-card {
    background: #e8f5e8;
    border-left: 5px solid #4CAF50;
}

.error-card {
    background: #ffeaa7;
    border-left: 5px solid #fdcb6e;
}

.search-form h3, .prayer-times h2, .qibla-compass h3 {
    color: #2d3436;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Form Layout Improvements */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
}

.form-separator {
    text-align: center;
    margin: 0 0;
    position: relative;
}

.form-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
    z-index: 1;
}

.form-separator span {
    background: white;
    padding: 0 15px;
    position: relative;
    z-index: 2;
    color: #666;
    font-size: 0.9em;
}

.form-group {
    margin-bottom: 0px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2d3436;
}

input, select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
}

/* City Select Styling */
.city-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

.city-select:focus {
    outline: none;
    border-color: #667eea;
}

.city-select optgroup {
    font-weight: bold;
    color: #667eea;
    font-size: 0.9em;
}

.city-select option {
    padding: 8px;
    font-size: 14px;
}

/* Search City Styles */
.search-city-container {
    margin-bottom: 20px;
    position: relative; /* Tambahkan ini */
}

.search-input-container {
    position: relative;
}

.search-input-container input {
    padding-right: 45px;
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.search-result-details {
    font-size: 0.85em;
    color: #666;
}

.search-result-coords {
    font-size: 0.8em;
    color: #888;
    margin-top: 2px;
}

.search-loading {
    padding: 15px;
    text-align: center;
    color: #666;
}

.search-loading i {
    margin-right: 8px;
}

.search-no-results {
    padding: 15px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Active search state */
.search-active {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-primary, .btn-secondary {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #636e72;
    color: white;
}

.btn-secondary:hover {
    background: #2d3436;
}

.prayer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.prayer-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.prayer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.prayer-card.current-prayer {
    background: #667eea;
    color: white;
    border-color: #5a6fd8;
}

.prayer-name {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 8px;
}

.prayer-time {
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 10px;
}

.prayer-icon {
    font-size: 1.5em;
    color: #667eea;
}

.current-prayer .prayer-icon {
    color: white;
}

.date-info, .method-info {
    font-size: 1.4em;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.compass-container {
    text-align: center;
    padding: 0px;
}

.compass {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    position: relative;
}

.compass-rose {
    width: 100%;
    height: 100%;
    border: 3px solid #2d3436;
    border-radius: 50%;
    position: relative;
    background: conic-gradient(
        #ff7675 0deg 90deg,
        #74b9ff 90deg 180deg,
        #55efc4 180deg 270deg,
        #ffeaa7 270deg 360deg
    );
}

.compass-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: left center;
    transition: transform 0.5s ease;
}

.compass-needle i {
    font-size: 2em;
    color: #d63031;
    transform: translate(-50%, -50%);
}

footer {
    font-size: 1.4em;
    font-weight: 700;
    text-align: center;
    color: white;
    margin-top: 0px;
    padding: 20px;
}

footer a {
    color: #ffeaa7;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: 'Memuat...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
}

/* Responsive Design - PERBAIKAN BAGIAN INI */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .prayer-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .compass {
        width: 150px;
        height: 150px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .city-select {
        font-size: 14px;
    }
    
    /* PERBAIKAN: Search results untuk mobile */
    .search-results {
        position: fixed; /* Tetap fixed untuk mobile */
        top: 50% !important; /* Posisi di tengah */
        left: 5% !important;
        right: 5% !important;
        bottom: auto !important;
        max-height: 60vh; /* Maximum height */
        transform: translateY(-50%); /* Center vertically */
        border-radius: 12px; /* Border radius lebih besar */
        border: 2px solid #667eea; /* Border lebih tebal */
        box-shadow: 0 10px 30px rgba(0,0,0,0.2); /* Shadow lebih besar */
        z-index: 9999; /* Pastikan paling atas */
    }
    
    .search-result-item {
        padding: 15px; /* Padding lebih besar untuk mobile */
        font-size: 16px; /* Font size lebih besar */
    }
    
    /* Pastikan background overlay */
    .search-results::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: -1;
    }
}