/* Nomad Speed Test - Main Stylesheet */

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

/* Menu Bar */
.menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(26, 35, 50, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hamburger-btn {
    background: none;
    border: none;
    color: #00d9ff;
    font-size: 2em;
    cursor: pointer;
    padding: 5px 10px;
    transition: all 0.3s ease;
}

.hamburger-btn:hover {
    color: #ffffff;
    transform: scale(1.1);
}

.login-btn-desktop {
    background: #00d9ff;
    color: #1a2332;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn-desktop:hover {
    background: #00b8d4;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .login-btn-desktop {
        display: none;
    }
}

/* Menu Dropdown */
.menu-dropdown {
    position: fixed;
    top: 60px;
    left: -250px;
    width: 250px;
    background: rgba(26, 35, 50, 0.98);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    transition: left 0.3s ease;
    z-index: 999;
    box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.3);
    height: calc(100vh - 60px);
}

.menu-dropdown.open {
    left: 0;
}

.menu-item {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: #ffffff;
    padding: 15px 30px;
    text-align: left;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.menu-item:hover {
    background: rgba(0, 217, 255, 0.1);
    border-left-color: #00d9ff;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #1a2332;
    border: 2px solid #00d9ff;
    border-radius: 15px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    position: relative;
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 2em;
    color: #00d9ff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #ffffff;
    transform: scale(1.2);
}

.modal-content h2 {
    color: #00d9ff;
    margin-bottom: 10px;
}

.modal-content p {
    color: #b8c5d0;
    margin-bottom: 20px;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    border: 2px solid #00d9ff;
    border-radius: 8px;
    background: rgba(42, 58, 74, 0.5);
    color: #ffffff;
    font-size: 1em;
    margin-bottom: 20px;
}

.modal-content input:focus {
    outline: none;
    border-color: #ffffff;
    background: rgba(42, 58, 74, 0.8);
}

.modal-btn {
    width: 100%;
    padding: 12px;
    background: #00d9ff;
    color: #1a2332;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    background: #00b8d4;
    transform: translateY(-2px);
}

.modal-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-size: 0.9em;
}

.modal-message.success {
    background: rgba(0, 217, 255, 0.2);
    color: #00d9ff;
}

.modal-message.error {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #0f1419 0%, #1a2838 50%, #0f1419 100%);
    min-height: 100vh;
    padding: 20px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 50px;
}

.header h1 {
    font-size: 3.5em;
    font-weight: 300;
    color: #00d9ff;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.header .subtitle {
    font-size: 1.2em;
    color: #b8c5d0;
    font-weight: 300;
}

/* Main Test Area */
.test-area {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 40px;
}

/* Info Cards */
.info-card {
    background: rgba(30, 42, 58, 0.75);
    border: 1px solid rgba(0, 217, 255, 0.15);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    min-height: 250px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 217, 255, 0.2);
}

.info-card .label {
    font-size: 0.75em;
    color: #8a9ba8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
}

.info-card .value {
    font-size: 1.1em;
    color: #ffffff;
    margin-bottom: 25px;
    font-weight: 300;
}

.info-card .flag {
    display: inline-block;
    margin-left: 8px;
    font-size: 1.2em;
}

/* GO Button Area */
.button-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.test-button {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 4px solid #00d9ff;
    background: radial-gradient(circle, #2a3a4a 0%, #1a2332 100%);
    color: white;
    font-size: 3em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.5);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.test-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 50px rgba(0, 217, 255, 0.8);
    border-width: 5px;
}

.test-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.test-button.testing {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 30px rgba(0, 217, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 60px rgba(0, 217, 255, 1);
    }
}

/* Processing dots animation - single dot blinking */
.metric .value.processing {
    color: #00d9ff;
    font-size: 3em;
}

.metric .value.processing::after {
    content: '·';
    animation: dotBlink 1s ease-in-out infinite;
}

@keyframes dotBlink {
    0%, 100% {
        opacity: 0.2;
    }
    50% {
        opacity: 1;
    }
}

/* Results Card */
.results-card {
    background: rgba(30, 42, 58, 0.75);
    border: 1px solid rgba(0, 217, 255, 0.15);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 217, 255, 0.2);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}

.metric {
    text-align: center;
}

.metric .label {
    font-size: 1.15em;
    color: #00d9ff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
    font-weight: 600;
}

.metric .previous-value {
    font-size: 0.9em;
    color: #8a9ba8;
    margin-bottom: 10px;
    margin-top: -5px;
    font-weight: 400;
}

.metric .value {
    font-size: 4em;
    font-weight: bold;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 5px;
}

.metric .unit {
    font-size: 1em;
    color: #8a9ba8;
    font-weight: 300;
}

/* Status Message */
.status-message {
    text-align: center;
    color: #00d9ff;
    font-size: 1em;
    margin: 20px 0;
    min-height: 25px;
    font-weight: 300;
}

/* Server Info */
.server-info {
    display: none;
    text-align: center;
    color: #b8c5d0;
    font-size: 0.9em;
    margin-top: 15px;
    font-weight: 300;
}

.server-info.visible {
    display: block;
}

/* Transfer Info */
.transfer-info {
    text-align: center;
    color: #8a9ba8;
    font-size: 0.9em;
    margin-top: 20px;
    font-weight: 300;
}

/* Analytics Section */
.analytics-section {
    margin-top: 30px;
}

.best-isp-card {
    background: rgba(30, 42, 58, 0.75);
    border: 1px solid rgba(0, 217, 255, 0.15);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 217, 255, 0.2);
    margin-bottom: 30px;
    text-align: center;
}

.best-isp-card h3 {
    color: #00d9ff;
    font-size: 1.3em;
    margin-bottom: 20px;
    font-weight: 400;
    letter-spacing: 1px;
}

.best-isp-content {
    font-size: 1.1em;
    color: #ffffff;
}

.best-isp-name {
    font-size: 2em;
    color: #00d9ff;
    font-weight: 600;
    margin: 15px 0;
}

.best-isp-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.best-isp-stat {
    padding: 10px 20px;
    background: rgba(0, 217, 255, 0.1);
    border-radius: 10px;
}

.best-isp-stat-label {
    font-size: 0.8em;
    color: #8a9ba8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.best-isp-stat-value {
    font-size: 1.5em;
    color: #00d9ff;
    font-weight: 600;
    margin-top: 5px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.chart-card {
    background: rgba(30, 42, 58, 0.75);
    border: 1px solid rgba(0, 217, 255, 0.15);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 217, 255, 0.2);
}

.chart-card h3 {
    color: #00d9ff;
    font-size: 1.1em;
    margin-bottom: 20px;
    font-weight: 400;
    letter-spacing: 1px;
}

.chart-container {
    min-height: 250px;
}

.chart-bar {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.chart-label {
    width: 180px;
    min-width: 180px;
    max-width: 180px;
    font-size: 0.85em;
    color: #ffffff;
    text-align: right;
    padding-right: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-bar-container {
    flex: 1;
    background: rgba(0, 217, 255, 0.1);
    border-radius: 8px;
    height: 30px;
    position: relative;
    display: flex;
    align-items: center;
}

.chart-bar-fill {
    background: linear-gradient(90deg, #00d9ff, #0099cc);
    height: 100%;
    border-radius: 8px;
    transition: width 0.6s ease;
    position: absolute;
    left: 0;
    top: 0;
}

.chart-bar-value {
    color: #ffffff;
    font-size: 0.85em;
    font-weight: 600;
    position: relative;
    z-index: 1;
    padding-left: 10px;
}

.chart-unit-label {
    text-align: center;
    color: #8a9ba8;
    font-size: 0.8em;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 217, 255, 0.1);
}

/* Log Section */
.log-section {
    background: rgba(30, 42, 58, 0.75);
    border: 1px solid rgba(0, 217, 255, 0.15);
    border-radius: 20px;
    padding: 20px;
    margin-top: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 217, 255, 0.2);
}

.log-section.collapsed .log-content {
    display: none;
}

.log-section .log-header {
    cursor: pointer;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.log-header h3 {
    color: #00d9ff;
    font-size: 1.1em;
    font-weight: 400;
    letter-spacing: 1px;
}

.copy-btn {
    padding: 8px 20px;
    background: #00d9ff;
    color: #1a2332;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #00b8d4;
    transform: translateY(-2px);
}

.log-content {
    background: #0d1117;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid #30363d;
}

.log-content::-webkit-scrollbar {
    width: 8px;
}

.log-content::-webkit-scrollbar-track {
    background: #161b22;
    border-radius: 10px;
}

.log-content::-webkit-scrollbar-thumb {
    background: #00d9ff;
    border-radius: 10px;
}

/* Footer */
.footer {
    text-align: center;
    color: #8a9ba8;
    margin-top: 40px;
    font-size: 0.85em;
    font-weight: 300;
}

.footer a {
    color: #00d9ff;
    text-decoration: none;
    font-weight: 400;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .test-area {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .button-area {
        order: -1;
        margin-bottom: 20px;
    }

    .header h1 {
        font-size: 2.5em;
    }

    .test-button {
        width: 150px;
        height: 150px;
        font-size: 2.5em;
    }
}

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

    .metric .value {
        font-size: 3em;
    }

    .metric .label {
        font-size: 0.95em;
    }

    .header h1 {
        font-size: 2em;
    }

    .header .subtitle {
        font-size: 1em;
    }

    .info-card {
        padding: 20px;
    }

    body {
        padding: 15px;
    }
}

/* Animation for value changes */
@keyframes valueChange {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); color: #00d9ff; }
    100% { transform: scale(1); }
}

.metric .value.updating {
    animation: valueChange 0.3s ease;
}
/* History Section */
.history-section {
    background: rgba(30, 42, 58, 0.75);
    border: 1px solid rgba(0, 217, 255, 0.15);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 217, 255, 0.2);
    backdrop-filter: blur(10px);
    margin-top: 30px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-header h3 {
    color: #00d9ff;
    font-size: 1.2em;
    font-weight: 400;
    letter-spacing: 1px;
}

.expand-all-btn {
    padding: 8px 20px;
    background: rgba(0, 217, 255, 0.2);
    color: #00d9ff;
    border: 1px solid #00d9ff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.expand-all-btn:hover {
    background: rgba(0, 217, 255, 0.3);
    transform: translateY(-2px);
}

.history-item {
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
    background: rgba(20, 28, 38, 0.5);
}

.history-item-header {
    display: grid;
    grid-template-columns: 40px 1fr 1fr 1fr 2fr 40px;
    gap: 10px;
    padding: 15px;
    background: rgba(20, 28, 38, 0.5);
    cursor: pointer;
    align-items: center;
    transition: all 0.3s ease;
}

.history-item-header:hover {
    background: rgba(0, 217, 255, 0.1);
}

.history-item-header.expanded {
    background: rgba(0, 217, 255, 0.15);
    border-bottom: 1px solid rgba(0, 217, 255, 0.3);
}

.expand-arrow {
    font-size: 1.2em;
    transition: transform 0.3s ease;
    text-align: center;
    color: #00d9ff;
}

.expand-arrow.rotated {
    transform: rotate(90deg);
}

.history-col {
    font-size: 0.9em;
}

.history-col-label {
    font-weight: 600;
    color: #666;
    font-size: 0.75em;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.history-item-header.expanded .history-col-label {
    color: rgba(255,255,255,0.8);
}

.history-col-value {
    font-size: 1em;
    color: #ffffff;
}

/* Flag column (5th column) - larger and centered on desktop */
.history-col:nth-child(5) {
    text-align: center;
}

.history-col:nth-child(5) .history-col-value {
    font-size: 1.8em;
}

.history-item-header.expanded .history-col-value {
    color: #ffffff;
    font-weight: 500;
}

.delete-btn {
    background: transparent;
    color: rgba(255, 100, 100, 0.7);
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
    transform: scale(1.1);
}

.history-item-details {
    display: none;
    padding: 20px;
    background: rgba(15, 20, 28, 0.6);
    border-top: 1px solid rgba(0, 217, 255, 0.2);
}

.history-item-details.show {
    display: block;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.detail-item {
    padding: 10px;
    background: rgba(0, 217, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 217, 255, 0.1);
}

.detail-label {
    font-size: 0.75em;
    color: #8a9ba8;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 0.95em;
    color: #ffffff;
    word-break: break-all;
}

@media (max-width: 768px) {
    .history-item-header {
        grid-template-columns: 25px 1fr 80px 1fr 35px 30px;
        gap: 8px;
        font-size: 0.8em;
        padding: 12px 8px;
    }

    .expand-arrow {
        font-size: 1em;
    }

    .history-col-label {
        font-size: 0.7em;
    }

    .history-col-value {
        font-size: 0.85em;
    }

    /* Data, Download, Operadora, País (bandeira), Lixeira */
    .history-col:nth-child(2) {
        grid-column: 2;
    }

    .history-col:nth-child(3) {
        grid-column: 3;
    }

    .history-col:nth-child(4) {
        grid-column: 4;
    }

    .history-col:nth-child(5) {
        grid-column: 5;
        text-align: center;
    }

    .history-col:nth-child(5) .history-col-label {
        font-size: 0.7em;
    }

    .history-col:nth-child(5) .history-col-value {
        font-size: 1.3em;
    }

    .delete-btn {
        grid-column: 6;
        padding: 5px 8px;
        font-size: 1em;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* User info in desktop top bar */
.user-info-desktop {
    color: #00d9ff;
    font-size: 0.85em;
    margin-right: 15px;
    display: flex;
    align-items: center;
}

@media (max-width: 768px) {
    .user-info-desktop {
        display: none !important;
    }
}

/* User info in menu (mobile) */
.menu-user-info {
    padding: 15px 30px;
    color: #00d9ff;
    font-size: 0.9em;
    border-bottom: 1px solid rgba(0, 217, 255, 0.2);
    margin-bottom: 10px;
}

/* Adjust container for menu bar */
.container {
    padding-top: 80px;
}
