/* ============================================
   IMEI Tracker Pro - Dashboard Styles
   Tema: Dark Cyber / Tracking Professional
   ============================================ */

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a1f2e;
    --bg-card-hover: #1f2537;
    --border-color: #2a3045;
    --text-primary: #e8edf5;
    --text-secondary: #8892a8;
    --text-muted: #5a6278;
    --accent-green: #00e676;
    --accent-green-dim: rgba(0, 230, 118, 0.15);
    --accent-blue: #00b4d8;
    --accent-blue-dim: rgba(0, 180, 216, 0.15);
    --accent-purple: #7c3aed;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    --glow-green: 0 0 20px rgba(0, 230, 118, 0.3);
    --glow-blue: 0 0 20px rgba(0, 180, 216, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

.scanlines {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 230, 118, 0.015) 2px,
        rgba(0, 230, 118, 0.015) 4px
    );
}

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

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

header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo i {
    font-size: 2rem;
    color: var(--accent-green);
    text-shadow: var(--glow-green);
    animation: pulse-sat 2s ease-in-out infinite;
}

@keyframes pulse-sat {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.logo h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.6);
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.status-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ======= CARDS ======= */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(0, 230, 118, 0.2);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.card-header i {
    font-size: 1.2rem;
    color: var(--accent-green);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
}

/* ======= SEARCH SECTION ======= */

.search-section {
    margin: 40px 0 30px;
}

.search-card {
    text-align: center;
    padding: 40px 24px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
    border: 1px solid rgba(0, 230, 118, 0.1);
}

.card-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--accent-green-dim);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon i {
    font-size: 1.5rem;
    color: var(--accent-green);
}

.search-card h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.input-group {
    display: flex;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    z-index: 1;
}

#imeiInput {
    flex: 1;
    padding: 14px 16px 14px 48px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1.05rem;
    font-family: 'Consolas', 'Courier New', monospace;
    letter-spacing: 2px;
    transition: var(--transition);
    outline: none;
}

#imeiInput:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px var(--accent-green-dim);
}

#imeiInput::placeholder {
    letter-spacing: 1px;
    color: var(--text-muted);
    font-family: 'Segoe UI', system-ui, sans-serif;
}

#searchBtn {
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--accent-green), #00c853);
    border: none;
    border-radius: var(--radius-sm);
    color: #000;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    white-space: nowrap;
}

#searchBtn:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-green);
}

#searchBtn:active {
    transform: translateY(0);
}

#searchBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.input-hints {
    display: flex;
    justify-content: space-between;
    max-width: 600px;
    margin: 8px auto 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.hint {
    color: var(--accent-orange);
}

.hint.valid {
    color: var(--accent-green);
}

.hint.invalid {
    color: var(--accent-red);
}

/* ======= LOADING ======= */

.loading-card {
    text-align: center;
    padding: 48px 24px;
    margin-bottom: 30px;
}

.loading-animation {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-animation i {
    font-size: 2rem;
    color: var(--accent-green);
    z-index: 1;
    animation: pulse-sat 1s ease-in-out infinite;
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent-green);
    border-radius: 50%;
    animation: pulse-ring 1.5s ease-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.progress-bar {
    width: 280px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin: 16px auto;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-blue));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ======= RESULTS GRID ======= */

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* ======= DEVICE INFO ======= */

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(42, 48, 69, 0.5);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-label i {
    width: 16px;
    color: var(--accent-blue);
}

.info-value {
    font-weight: 600;
    font-size: 0.9rem;
    text-align: right;
}

.info-value.green { color: var(--accent-green); }
.info-value.blue { color: var(--accent-blue); }
.info-value.purple { color: var(--accent-purple); }
.info-value.orange { color: var(--accent-orange); }
.info-value.red { color: var(--accent-red); }

/* ======= LOCATION DETAILS ======= */

.location-details .info-row:first-child .info-value {
    font-family: 'Consolas', monospace;
    font-size: 0.8rem;
    color: var(--accent-blue);
}

/* ======= DATA SOURCE BADGE ======= */

.source-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 16px;
    font-weight: 500;
}

.source-badge.real {
    background: var(--accent-green-dim);
    border: 1px solid rgba(0, 230, 118, 0.3);
    color: var(--accent-green);
}

.source-badge.mock {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: var(--accent-orange);
}

.real-badge, .mock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 6px;
}

.real-badge {
    background: var(--accent-green-dim);
    color: var(--accent-green);
    border: 1px solid rgba(0, 230, 118, 0.3);
}

.mock-badge {
    background: rgba(245, 158, 11, 0.08);
    color: var(--accent-orange);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

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

.map-card {
    margin-bottom: 16px;
}

.coord-display {
    font-family: 'Consolas', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 4px 10px;
    border-radius: 4px;
}

#map {
    height: 400px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    z-index: 1;
}

#map .leaflet-control-zoom a {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

#map .leaflet-control-zoom a:hover {
    background: var(--bg-card-hover);
}

/* ======= DISCLAIMER ======= */

.disclaimer-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.2);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.disclaimer-card i {
    color: var(--accent-orange);
    font-size: 1.2rem;
    margin-top: 2px;
    flex-shrink: 0;
}

/* ======= HISTORY ======= */

#historySection {
    margin-bottom: 30px;
}

#clearHistory {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

#clearHistory:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(42, 48, 69, 0.4);
    cursor: pointer;
    transition: var(--transition);
}

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

.history-item:hover {
    color: var(--accent-green);
    padding-left: 8px;
}

.history-imei {
    font-family: 'Consolas', monospace;
    font-weight: 600;
}

.history-device {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.history-time {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ======= FOOTER ======= */

footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    margin-top: 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-disclaimer {
    font-size: 0.75rem;
}

/* ======= UTILITY ======= */

.hidden {
    display: none !important;
}

/* ======= SCROLLBAR ======= */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ======= BATTERY ICON ======= */

.battery-icon {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.battery-icon .fa-battery-full { color: var(--accent-green); }
.battery-icon .fa-battery-three-quarters { color: var(--accent-green); }
.battery-icon .fa-battery-half { color: var(--accent-orange); }
.battery-icon .fa-battery-quarter { color: var(--accent-red); }
.battery-icon .fa-battery-empty { color: var(--accent-red); }

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

@media (max-width: 640px) {
    .header-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .input-group {
        flex-direction: column;
    }

    .logo {
        justify-content: center;
    }

    .search-card h2 {
        font-size: 1.15rem;
    }

    #map {
        height: 280px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}
