/* Network Check CSS - Extracted from bsnl-network-check.html */

/* Scoped Colors for Network Check Section */
#network-check-section {
    --bg-primary: transparent;
    /* Use homepage background */
    --bg-secondary: rgba(255, 255, 255, 0.05);
    --bg-glass: rgba(255, 255, 255, 0.05);
    /* Match homepage card style */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.2);
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    margin-top: 40px;
    margin-bottom: 40px;
}

#network-check-section .glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px var(--shadow-color);
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

#network-check-section .glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px var(--shadow-color);
}

/* Search Section */
#network-check-section .search-section {
    text-align: center;
    margin-bottom: 2rem;
}

#network-check-section .search-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#network-check-section .search-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2rem;
}

#network-check-section .search-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

#network-check-section .input-group {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
    position: relative;
    text-align: left;
}

#network-check-section .input-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    background: #ffffff;
    color: #333333;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

/* Light Mode Support for Network Check Section */
body.light-mode #network-check-section {
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --bg-secondary: #ffffff;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.05);
}

body.light-mode #network-check-section .glass-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

#network-check-section .input-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

#network-check-section .input-group i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Buttons */
#network-check-section .btn {
    padding: 1rem 2rem;
    border-radius: 16px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

#network-check-section .btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

#network-check-section .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.4);
}

#network-check-section .btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

#network-check-section .btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Loading Overlay for this section */
#network-loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#network-loading-overlay.active {
    display: flex;
}

#network-loading-overlay .loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

#network-loading-overlay p {
    color: white;
    font-size: 1.1rem;
}

/* Results Section */
#network-results-section {
    display: none;
}

#network-results-section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

/* Signal Gauge */
#network-check-section .signal-gauge {
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
    position: relative;
    display: flex;
    /* Fix alignment */
    justify-content: center;
    align-items: center;
}

#network-check-section .signal-gauge svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

#network-check-section .gauge-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 12;
}

#network-check-section .gauge-fill {
    fill: none;
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out;
}

#network-check-section .gauge-fill.excellent {
    stroke: var(--success);
}

#network-check-section .gauge-fill.good {
    stroke: #22c55e;
}

#network-check-section .gauge-fill.moderate {
    stroke: var(--warning);
}

#network-check-section .gauge-fill.poor {
    stroke: #f97316;
}

#network-check-section .gauge-fill.very-poor {
    stroke: var(--danger);
}

#network-check-section .signal-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
}

#network-check-section .signal-percent {
    font-size: 3rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#network-check-section .signal-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

#network-check-section .signal-status {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

#network-check-section .signal-status.excellent {
    color: var(--success);
}

#network-check-section .signal-status.good {
    color: #22c55e;
}

#network-check-section .signal-status.moderate {
    color: var(--warning);
}

#network-check-section .signal-status.poor {
    color: #f97316;
}

#network-check-section .signal-status.very-poor {
    color: var(--danger);
}

#network-check-section .tower-count {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    width: fit-content;
    margin: 0 auto;
}

/* Network Grid */
#network-check-section .network-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    #network-check-section .network-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 400px) {
    #network-check-section .network-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
}

#network-check-section .network-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 0;
    /* Prevent grid blowout */
}

#network-check-section .network-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

#network-check-section .network-card.active::before {
    background: var(--accent-gradient);
}

#network-check-section .network-card.inactive {
    opacity: 0.5;
}

#network-check-section .network-type {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

#network-check-section .network-2g {
    color: #94a3b8;
}

#network-check-section .network-3g {
    color: #f59e0b;
}

#network-check-section .network-4g {
    color: #3b82f6;
}

#network-check-section .network-5g {
    color: #8b5cf6;
}

#network-check-section .network-signal {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    word-break: break-word;
}

/* Map Section */
#network-check-section .map-section {
    padding: 0;
    overflow: hidden;
}

#network-check-section .map-header {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

#network-check-section .map-container {
    height: 400px;
    width: 100%;
}

#network-map {
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Ensure map is interactable */
}

/* Tower List */
#network-check-section .tower-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

#network-check-section .tower-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    flex-shrink: 0;
}

#network-check-section .tower-icon.tower-2g {
    background: linear-gradient(135deg, #64748b, #94a3b8);
}

#network-check-section .tower-icon.tower-3g {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

#network-check-section .tower-icon.tower-4g {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

#network-check-section .tower-icon.tower-5g {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
}

#network-check-section .tower-info {
    flex: 1;
    text-align: left;
}

#network-check-section .tower-id {
    font-weight: 600;
    color: var(--text-primary);
}

#network-check-section .tower-distance {
    font-size: 0.85rem;
    color: var(--text-muted);
}

#network-check-section .tower-signal-value {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #network-check-section .search-form {
        flex-direction: column;
    }

    #network-check-section .input-group {
        width: 100%;
        max-width: none;
    }

    #network-check-section .btn {
        width: 100%;
        justify-content: center;
    }

    #network-check-section .network-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Custom Leaflet Markers */
.custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    font-size: 11px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    border: 3px solid white;
}

.marker-2g {
    background: linear-gradient(135deg, #64748b, #94a3b8);
}

.marker-3g {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.marker-4g {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.marker-5g {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
}

.marker-user {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 0;
}

.leaflet-popup-content {
    margin: 12px;
}

.popup-title {
    font-weight: 700;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.popup-info {
    font-size: 0.85rem;
    color: #666;
}