/* WiFi Speed Test Tool Styles - Following WHOIS Design Pattern */

/* Hero Section Styles */
.wifi-hero {
    background: linear-gradient(135deg, #0056b3 0%, #007bff 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Top Info Bar (Screenshot style) */
.wifi-info-bar {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 1rem;
    border-radius: 8px 8px 0 0;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Side Speed Stats */
.side-speed-stats {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
}

.side-speed-stats.left {
    left: 10px;
}

.side-speed-stats.right {
    right: 10px;
}

.side-speed-label {
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.side-speed-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.wifi-hero h1 {
    font-weight: 600;
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.wifi-hero .lead {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Container Styles */
.wifi-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Dark Mode Support */
[data-theme="dark"] .wifi-container {
    background-color: var(--card-bg, #1e293b);
    color: var(--text-primary, #e2e8f0);
    border: 1px solid var(--border-color, #334155);
}

[data-theme="dark"] .wifi-info-bar {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

[data-theme="dark"] .wifi-hero {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}

/* Test Form Styles */
.wifi-form {
    margin-bottom: 0;
}

.wifi-form h4 {
    color: #0056b3;
    font-weight: 600;
}

[data-theme="dark"] .wifi-form h4 {
    color: var(--accent-color);
}

/* Control Buttons */
.control-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.btn-control {
    padding: 12px 24px;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

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

.btn-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Speedometer Styles */
.speedometer-section {
    text-align: center;
    padding: 20px;
    background: var(--bg-primary, #ffffff);
    border-radius: 8px;
    margin-bottom: 20px;
}

.speedometer-canvas {
    max-width: 100%;
    height: 200px;
    margin: 0 auto;
}

.speed-display {
    margin-top: 10px;
}

.speed-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f59e0b;
}

/* Chart Styles */
.chart-section {
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.chart-canvas {
    max-width: 100%;
    height: 200px !important;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    border-left: 4px solid #3b82f6;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary, #6b7280);
    font-weight: 500;
}

/* WiFi Table */
.wifi-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary, #ffffff);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wifi-table th,
.wifi-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.wifi-table th {
    background: var(--bg-secondary, #f8f9fa);
    font-weight: 600;
    color: var(--text-primary, #1f2937);
}

.wifi-table td {
    color: var(--text-secondary, #6b7280);
}

/* Protocol Tabs */
.protocol-tabs {
    margin-top: 20px;
}

.protocol-tab-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 6px;
    padding: 5px;
}

.protocol-tab-link {
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary, #6b7280);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.protocol-tab-link:hover {
    background: var(--bg-primary, #ffffff);
    color: var(--text-primary, #1f2937);
}

.protocol-tab-link.active {
    background: #f59e0b;
    color: white;
}

.protocol-tab-content {
    display: none;
    padding: 15px;
    background: var(--bg-primary, #ffffff);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e5e7eb);
}

.protocol-tab-content.active {
    display: block;
}

/* Error Messages */
.wifi-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: 500;
}

[data-theme="dark"] .wifi-error {
    background: #7f1d1d;
    border-color: #991b1b;
    color: #fca5a5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .control-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-control {
        width: 200px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .protocol-tab-navigation {
        flex-direction: column;
    }
    
    .tab-navigation {
        flex-direction: column;
        gap: 5px;
    }
    
    .speedometer-canvas {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .wifi-container {
        padding: 10px;
    }
    
    .speedometer-section {
        padding: 15px;
    }
    
    .chart-section {
        padding: 10px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}

/* Tab Navigation - Screenshot Style */
.tab-container {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.tab-navigation {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    margin: 0;
    background: #2f3136;
    border-radius: 6px;
    padding: 6px 8px;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.25);
}

[data-theme="dark"] .tab-navigation {
    background: #1f2937; /* dark slate */
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.4);
}

.tab-link {
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #cbd5e1; /* slate-300 */
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    transition: color 0.2s ease;
    border-bottom: 3px solid transparent;
}

.tab-link:hover {
    color: #e5e7eb; /* slate-100 */
}

.tab-link.active {
    color: #f59e0b; /* amber-500 */
    border-bottom: 3px solid #f59e0b;
}

[data-theme="dark"] .tab-link {
    color: #9ca3af;
}

[data-theme="dark"] .tab-link.active {
    color: #f59e0b;
    border-bottom-color: #f59e0b;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 1.5rem 0;
}

.tab-content.active {
    display: block;
}

/* Speedometer Section */
.speedometer-section {
    text-align: center;
    padding: 2rem 0;
}

.speedometer-canvas {
    width: 100%;
    max-width: 400px;
    height: 180px;
    margin: 0 auto;
    display: block;
}

.speed-display {
    margin-top: 1.5rem;
}

.speed-value {
    font-size: 3rem;
    font-weight: 700;
    color: #0056b3;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .speed-value {
    color: var(--accent-color);
}

.speed-label {
    font-size: 1.1rem;
    color: #6c757d;
}

[data-theme="dark"] .speed-label {
    color: var(--text-secondary);
}

/* Stats Grid - Following WHOIS Table Pattern */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

[data-theme="dark"] .stat-card {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #0056b3;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .stat-value {
    color: var(--accent-color);
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .stat-label {
    color: var(--text-secondary);
}

/* WiFi Info Table - Following WHOIS Table Style */
.wifi-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.wifi-table tr {
    border-bottom: 1px solid #e0e0e0;
}

[data-theme="dark"] .wifi-table tr {
    border-bottom-color: var(--border-color);
}

.wifi-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
}

[data-theme="dark"] .wifi-table th {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.wifi-table td {
    padding: 0.75rem;
    color: #212529;
}

[data-theme="dark"] .wifi-table td {
    color: var(--text-primary);
}

/* Chart Section */
.chart-section {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 8px;
    margin: 0.75rem 0;
}

[data-theme="dark"] .chart-section {
    background-color: var(--bg-secondary);
}

.chart-canvas {
    width: 100% !important;
    max-height: 300px !important;
}

/* Error Message - Following WHOIS Pattern */
.wifi-error {
    display: none;
    background-color: #fff5f5;
    color: #e53e3e;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #e53e3e;
}

[data-theme="dark"] .wifi-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-left-color: #ef4444;
}

/* Results Section */
.wifi-results {
    display: block;
}

.section-title {
    color: #333;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
    font-size: 1.5rem;
    font-weight: 600;
}

[data-theme="dark"] .section-title {
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}

/* Control Buttons */
.control-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.btn-control {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
}

/* Progress Bar */
.progress-section {
    margin: 1.5rem 0;
}

.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

[data-theme="dark"] .progress {
    background-color: var(--bg-tertiary);
}

.progress-bar {
    background-color: #0056b3;
    transition: width 0.3s ease;
}

[data-theme="dark"] .progress-bar {
    background-color: var(--accent-color);
}

/* Port Check Results */
.port-results {
    margin-top: 1.5rem;
}

.port-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .port-item {
    background-color: var(--bg-secondary);
}

.port-status-open {
    color: #28a745;
    font-weight: 600;
}

.port-status-closed {
    color: #dc3545;
    font-weight: 600;
}

/* Toggle Switch Styles */
.test-toggles {
    background: var(--bg-secondary, #f8f9fa);
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.toggle-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background-color: #f59e0b;
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(26px);
}

[data-theme="dark"] .toggle-switch .slider {
    background-color: var(--bg-tertiary, #334155);
}

[data-theme="dark"] .toggle-switch input:checked + .slider {
    background-color: #f59e0b;
}

/* Protocol Tabs Styles */
.protocol-tabs {
    margin-top: 2rem;
    border-top: 2px solid var(--border-color, #e0e0e0);
    padding-top: 1.5rem;
}

.protocol-tab-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-secondary, #f8f9fa);
    padding: 0.5rem;
    border-radius: 6px;
}

.protocol-tab-link {
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary, #6c757d);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.protocol-tab-link:hover {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.protocol-tab-link.active {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

[data-theme="dark"] .protocol-tab-navigation {
    background: var(--bg-tertiary, #1a1f2e);
}

[data-theme="dark"] .protocol-tab-link {
    color: var(--text-secondary, #9ca3af);
}

[data-theme="dark"] .protocol-tab-link:hover {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

[data-theme="dark"] .protocol-tab-link.active {
    background: #f59e0b;
    color: white;
}

.protocol-tab-content {
    display: none;
    padding: 1rem 0;
}

.protocol-tab-content.active {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wifi-hero h1 {
        font-size: 1.75rem;
    }
    
    .wifi-container {
        padding: 0.75rem;
    }
    
    /* Info Bar */
    .wifi-info-bar {
        font-size: 0.75rem;
        padding: 0.75rem;
    }
    
    /* Control Buttons */
    .control-buttons {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .btn-control {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Tab Navigation */
    .tab-navigation {
        gap: 0.25rem;
        flex-wrap: wrap;
    }
    
    .tab-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    /* Protocol Tabs */
    .protocol-tab-navigation {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .protocol-tab-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
    }
    
    /* Speedometer */
    .speedometer-canvas {
        max-width: 100%;
        height: auto !important;
    }
    
    .side-speed-stats {
        font-size: 0.7rem;
    }
    
    .side-speed-value {
        font-size: 0.9rem;
    }
    
    .speed-value {
        font-size: 1.5rem;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    /* WiFi Table */
    .wifi-table {
        font-size: 0.85rem;
    }
    
    /* Chart Section */
    .chart-canvas {
        height: 150px !important;
    }
    
    /* Toggle Switches */
    .test-toggles .row {
        margin: 0;
    }
    
    .test-toggles .col-md-6 {
        padding: 0 0.25rem;
    }
    
    .toggle-label {
        font-size: 0.85rem;
    }
}

/* Extra Small Devices */
@media (max-width: 576px) {
    .wifi-hero {
        padding: 2rem 0;
    }
    
    .wifi-hero h1 {
        font-size: 1.5rem;
    }
    
    .wifi-container {
        padding: 0.5rem;
    }
    
    /* Tabs - Stack on small screens */
    .tab-link {
        padding: 0.4rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .protocol-tab-link {
        padding: 0.35rem 0.5rem;
        font-size: 0.65rem;
    }
    
    /* Speedometer - Smaller */
    .speedometer-section {
        padding: 0.5rem;
    }
    
    .speed-value {
        font-size: 1.2rem;
    }
    
    /* WiFi/Internet Info Boxes - Stack */
    .row .col-md-6 {
        margin-bottom: 0.5rem;
    }
    
    /* Control Buttons - Stack on very small screens */
    .control-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-control {
        width: 100%;
        padding: 0.6rem;
    }
    
    /* WiFi/Internet Info Cards - Larger text for mobile */
    .wifi-info-card,
    .internet-info-card {
        padding: 0.75rem !important;
    }
    
    .wifi-section-title,
    .internet-section-title {
        font-size: 1rem !important;
    }
    
    .wifi-info-content,
    .internet-info-content {
        font-size: 0.9rem !important;
    }
}

/* WiFi/Internet Info Cards - Enhanced Styling */
.wifi-info-card,
.internet-info-card {
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wifi-info-card:hover,
.internet-info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .wifi-info-card,
[data-theme="dark"] .internet-info-card {
    background-color: var(--bg-tertiary, #0f172a) !important;
    border-left-color: #10b981 !important;
}

[data-theme="dark"] .internet-info-card {
    border-left-color: #3b82f6 !important;
}

/* Improve readability */
.wifi-info-content span,
.internet-info-content span {
    word-break: break-word;
}
