:root {
    --primary-color: #4b6cb7;
    --secondary-color: #00b09b;
    --dark-color: #182848;
    --light-color: #f5f5f5;
    --text-color: #333;
    --text-light: #666;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: var(--text-color);
}

.container {
    background-color: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    padding: 30px;
    width: 90%;
    max-width: 600px;
    text-align: center;
}

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

h1 {
    color: var(--dark-color);
    margin: 0;
    font-size: 1.8rem;
}

.speedometer {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
    gap: 20px;
}

.gauge {
    width: 45%;
    min-width: 150px;
}

.gauge-body {
    width: 100%;
    height: 0;
    padding-bottom: 50%;
    position: relative;
    border-top-left-radius: 100% 200%;
    border-top-right-radius: 100% 200%;
    overflow: hidden;
    background-color: #f0f0f0;
}

.gauge-fill {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: center top;
    transform: rotate(0.5turn);
    transition: transform 0.8s ease-out, background-color 0.3s;
}

.download-gauge .gauge-fill {
    background: linear-gradient(to right, var(--primary-color), var(--dark-color));
}

.upload-gauge .gauge-fill {
    background: linear-gradient(to right, var(--secondary-color), #96c93d);
}

.gauge-cover {
    width: 75%;
    height: 150%;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
    color: var(--text-color);
}

.gauge-label {
    font-size: 1.1em;
    margin-top: 15px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ping-display {
    font-size: 1.2em;
    margin: 25px 0;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#ping-value {
    font-weight: bold;
    color: var(--primary-color);
}

.test-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.test-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1em;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.test-button:hover {
    background-color: var(--dark-color);
    transform: translateY(-2px);
}

.test-button:active {
    transform: translateY(0);
}

.test-button i {
    font-size: 1em;
}

.info-button {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-button:hover {
    background-color: var(--primary-color);
    color: white;
}

.status {
    margin: 20px 0;
    color: var(--text-light);
    font-style: italic;
    min-height: 24px;
}

.history {
    margin-top: 30px;
    text-align: left;
}

.history h3 {
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}

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

.history-date {
    color: var(--text-light);
    font-size: 0.9em;
}

.history-speeds {
    display: flex;
    gap: 15px;
}

.history-speed {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.history-speed span:first-child {
    font-size: 0.8em;
    color: var(--text-light);
}

.history-speed span:last-child {
    font-weight: bold;
}

/* HELAL Stamp Styles */
.helal-stamp {
    display: inline-block;
    background: #000;
    border-radius: 4px;
    padding: 4px 8px 4px 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.helal-stamp:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.stamp-inner {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stamp-text {
    color: #aaa;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: normal;
}

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

.helal-logo span {
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
}

.logo-container {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid white;
}

.logo-container img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 25px;
    border-radius: 10px;
    width: 80%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 24px;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
}

.close:hover {
    color: var(--text-color);
}

.modal-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

/* Responsive adjustments */
@media (max-width: 500px) {
    .speedometer {
        flex-direction: column;
        align-items: center;
    }
    
    .gauge {
        width: 80%;
        margin-bottom: 20px;
    }
    
    .header {
        flex-direction: column;
        gap: 10px;
    }
}
