/* Custom SpeedTest CSS for TestSpeed.it */

/* Global Body Optimization */
body {
    overflow-x: hidden;
}

/* Mobile Body Optimization */
@media (max-width: 768px) {
    body {
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
    
    html {
        overflow-x: hidden !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
    
    .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .col-sm-12, .col-xs-12 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* Speed Test Container */
.speedtest-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .speedtest-container {
        min-height: 100vh;
        height: auto;
        padding: 10px 0;
    }
}

@media (max-width: 576px) {
    .speedtest-container {
        min-height: 100vh;
        height: 100vh;
        padding: 0;
        margin: 0;
        width: 100vw;
        box-sizing: border-box;
    }
}

.custom-speedtest {
    width: 100%;
    height: 650px;
    background: linear-gradient(135deg, #1B1C41 0%, #26273b 100%);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0 auto;
    max-width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .custom-speedtest {
        height: auto;
        min-height: 500px;
        max-height: 90vh;
        padding: 15px;
        border-radius: 10px;
        margin: 10px;
    }
    
    .gauge-container {
        width: 150px;
        height: 150px;
    }
    
    .gauge-svg {
        width: 150px;
        height: 150px;
    }
    
    .speedtest-gauge {
        margin-bottom: 20px;
    }
    
    .test-results {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
        margin-bottom: 20px;
    }
    
    .test-controls {
        display: block;
        margin-top: 15px;
        text-align: center;
    }
    
    .start-test-btn, .stop-test-btn {
        padding: 12px 30px;
        font-size: 14px;
        margin: 10px auto;
        display: block;
        width: fit-content;
    }
}

@media (max-width: 576px) {
    .custom-speedtest {
        height: auto !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        padding: 5px !important;
        border-radius: 0 !important;
        margin: 0 !important;
        width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    .gauge-container {
        width: 100px;
        height: 100px;
    }
    
    .gauge-svg {
        width: 100px;
        height: 100px;
    }
    
    .gauge-text-overlay .speed-value {
        font-size: 1.5rem;
    }
    
    .gauge-info h3 {
        font-size: 0.8rem;
    }
    
    .speedtest-gauge {
        margin-bottom: 10px;
    }
    
    .test-results {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        margin-top: 10px !important;
        margin-bottom: 10px !important;
    }
    
    .test-controls {
        display: block !important;
        margin-top: 10px !important;
        margin-bottom: 10px !important;
        text-align: center !important;
    }
    
    .start-test-btn, .stop-test-btn {
        padding: 10px 25px !important;
        font-size: 13px !important;
        margin: 5px auto !important;
        display: block !important;
        width: fit-content !important;
    }
    
    .result-item {
        padding: 4px 8px;
        min-height: 40px;
    }
    
    .result-label {
        font-size: 10px;
        margin-bottom: 2px;
    }
    
    .result-value {
        font-size: 0.9rem;
    }
    
    .change-server-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
}

.custom-speedtest::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(252, 200, 98, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(241, 90, 43, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Header Styles */
.speedtest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

.server-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.server-flag {
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.server-details {
    color: white;
}

.server-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
}

.server-location {
    font-size: 14px;
    color: #FCC862;
    opacity: 0.8;
}

.change-server-btn {
    background: rgba(252, 200, 98, 0.2);
    border: 2px solid #FCC862;
    color: #FCC862;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.change-server-btn:hover {
    background: #FCC862;
    color: #1B1C41;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(252, 200, 98, 0.3);
}

/* Main Gauge Styles */
.speedtest-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

.gauge-container {
    position: relative;
    margin-bottom: 20px;
}

.gauge-text-overlay {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    pointer-events: none;
}

/* Mobilde gauge text overlay'i ortala */
@media (max-width: 768px) {
    .gauge-text-overlay {
        top: 50%;
    }
    
    /* Mobilde gauge'i büyült */
    .gauge-svg {
        width: 250px;
        height: 250px;
    }
    
    /* Mobilde yazı boyutlarını küçült */
    .gauge-text-overlay .speed-value {
        font-size: 24px !important;
    }
    
    .gauge-text-overlay .speed-unit {
        font-size: 12px !important;
    }
}

.gauge-text-overlay .speed-value {
    font-size: 36px;
    font-weight: bold;
    line-height: 1;
    margin: 0;
}

.gauge-text-overlay .speed-unit {
    font-size: 18px;
    opacity: 0.8;
    line-height: 1;
    margin: 0;
}

.gauge-svg {
    width: 200px;
    height: 200px;
    max-width: 100%;
    height: auto;
    transform-origin: center;
    transform: rotate(-90deg);
}

.gauge-info {
    text-align: center;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.progress-circle {
    transition: stroke-dashoffset 0.5s ease;
    stroke: #FF8C00 !important; /* Daha belirgin turuncu */
    stroke-width: 8px; /* Daha kalın çizgi */
}

/* Test sırasında sadece progress circle'ı döndür - kaldırıldı, aşağıda birleştirildi */

@keyframes rotate-progress {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Smooth transition for testing state */
.gauge-svg {
    transition: all 0.3s ease;
}

/* Test sırasında sadece progress circle'ı döndür */
.gauge-svg.testing .progress-circle {
    animation: rotate-progress 2s linear infinite;
    transform-origin: center;
    stroke: #FF6600 !important; /* Daha parlak turuncu */
    stroke-width: 8px; /* Daha kalın çizgi */
}

.gauge-text {
    font-family: 'Segoe UI', sans-serif;
    fill: white;
    text-anchor: middle;
    dominant-baseline: central;
}

.speed-value {
    font-size: 36px;
    font-weight: bold;
    dominant-baseline: middle;
}

.speed-unit {
    font-size: 18px;
    opacity: 0.8;
    dominant-baseline: middle;
}


.test-status {
    color: #FCC862;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    margin-top: 10px;
}

/* Test Results */
.test-results {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

/* Mobile Test Results Override */
@media (max-width: 576px) {
    .test-results {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        margin-top: 10px !important;
        margin-bottom: 10px !important;
    }
}

.result-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.result-label {
    color: #FCC862;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-value {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.result-unit {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 400;
}

/* Control Buttons */
/* Test Controls */
.test-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    position: relative;
    z-index: 2;
}

/* Mobile Test Controls Override */
@media (max-width: 576px) {
    .test-controls {
        display: block !important;
        margin-top: 10px !important;
        margin-bottom: 10px !important;
        text-align: center !important;
    }
    
    .start-test-btn {
        padding: 10px 25px !important;
        font-size: 13px !important;
        margin: 5px auto !important;
        width: fit-content !important;
    }
    
    .stop-test-btn {
        padding: 10px 25px !important;
        font-size: 13px !important;
        margin: 5px auto !important;
        width: fit-content !important;
    }
    
    /* Server Selector Mobile */
    .modal-content {
        padding: 15px !important;
        margin: 10px !important;
        max-width: 95% !important;
        border-radius: 15px !important;
    }
    
    .modal-header {
        margin-bottom: 15px !important;
        padding-bottom: 10px !important;
    }
    
    .modal-header h3 {
        font-size: 18px !important;
    }
    
    .server-item {
        padding: 12px !important;
        gap: 10px !important;
    }
    
    .server-item .server-flag {
        font-size: 18px !important;
    }
    
    .server-item .server-name {
        font-size: 14px !important;
    }
    
    .server-item .server-location {
        font-size: 12px !important;
    }
    
    .server-item .server-ping {
        font-size: 12px !important;
        padding: 4px 8px !important;
    }
}

.start-test-btn, .stop-test-btn {
    background: linear-gradient(135deg, #FCC862 0%, #F15A2B 100%);
    border: none;
    color: white;
    padding: 15px 40px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(252, 200, 98, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.start-test-btn:hover, .stop-test-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(252, 200, 98, 0.4);
}

.stop-test-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
    display: none;
}

.stop-test-btn:hover {
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

/* Server Selector Modal */
.server-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #1B1C41 0%, #26273b 100%);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(252, 200, 98, 0.3);
}

.modal-header h3 {
    color: white;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #FCC862;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(252, 200, 98, 0.2);
    transform: rotate(90deg);
}

.server-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.server-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.server-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #FCC862;
    transform: translateX(5px);
}

.server-item .server-flag {
    font-size: 24px;
}

.server-item .server-info {
    flex: 1;
}

.server-item .server-name {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.server-item .server-location {
    color: #FCC862;
    font-size: 14px;
    opacity: 0.8;
}

.server-ping {
    color: white;
    font-size: 16px;
    font-weight: 600;
    background: rgba(252, 200, 98, 0.2);
    padding: 8px 12px;
    border-radius: 20px;
    min-width: 60px;
    text-align: center;
}

/* Additional responsive styles merged above */

@media (max-width: 480px) {
    .test-results {
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin-top: 10px;
        margin-bottom: 15px;
    }
    
    .test-controls {
        display: block;
        margin-top: 10px;
        text-align: center;
    }
    
    .start-test-btn, .stop-test-btn {
        padding: 10px 25px;
        font-size: 12px;
        margin: 8px auto;
        display: block;
        width: fit-content;
    }
    
    .gauge-container {
        width: 100px;
        height: 100px;
    }
    
    .gauge-svg {
        width: 100px;
        height: 100px;
    }
    
    .speed-value {
        font-size: 24px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 20px;
    }
}

/* Animation Classes */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Pulse animasyonu kaldırıldı - gauge küçülmesin */
.testing .gauge-container {
    /* animation: pulse 2s infinite; */
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item {
    animation: fadeInUp 0.6s ease forwards;
}

.result-item:nth-child(1) { animation-delay: 0.1s; }
.result-item:nth-child(2) { animation-delay: 0.2s; }
.result-item:nth-child(3) { animation-delay: 0.3s; }
.result-item:nth-child(4) { animation-delay: 0.4s; }

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(252, 200, 98, 0.3), transparent);
    animation: loading 2s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

