/* ========== Global Reset ========== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ========== Base Styles ========== */
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: #111;
    color: #f1f1f1;
    padding: 32px;
    line-height: 1.6;
}

h1 {
    text-align: center;
    margin-bottom: 32px;
    color: #00ffc3;
    letter-spacing: 1px;
}

/* ========== Layout Container ========== */
main {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ========== Buttons ========== */
button {
    background-color: #222;
    color: #f1f1f1;
    border: 1px solid #444;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-size: 16px;
}

button:hover {
    background-color: #00ffc3;
    color: #000;
    border-color: #00ffc3;
}

button:active {
    background-color: #00ccaa;
    color: #000;
    transform: scale(0.98);
    box-shadow: 0 0 0 2px #00ccaa55;
}

button:focus-visible {
    outline: 2px solid #00ffc3;
    outline-offset: 2px;
}

button:disabled {
    background-color: #333;
    color: #777;
    border-color: #444;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ========== Call Control Sections ========== */
#start-call-section,
#receive-call-button-container,
#receive-call-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#call-link-container {
    display: flex;
    gap: 8px;
    flex-direction: row;
    align-items: center;
}

#call-link {
    flex: 1;
}

/* ========== Inputs ========== */
input[type="text"] {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #444;
    background-color: #1b1b1b;
    color: #f1f1f1;
    font-size: 15px;
}

input[type="range"] {
    width: 100%;
    margin-top: 8px;
}

select {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #444;
    background-color: #1b1b1b;
    color: #f1f1f1;
}

/* ========== Audio Controls ========== */
#audio-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#audio-controls button:not(.circle-button) {
    width: 100%;
}

/* Call action buttons: Mute & End */
#audio-controls .call-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 8px;
}

#audio-controls .circle-button {
    width: 56px !important;
    height: 56px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

#volume-slider:hover {
    cursor: pointer;
}

/* Mute default state */
#mute-button {
    background-color: #222;
    border: 2px solid #00ffc3;
}

/* Mute active state */
#mute-button.active {
    background-color: #ff5e5e;
    border: 2px solid #ff5e5e;
}

#mute-mic-button {
    background-color: #222;
    border: 2px solid #00ffc3;
}

#mute-mic-button.active {
    background-color: #ff5e5e;
    border: 2px solid #ff5e5e;
}

/* End call */
#end-call-button {
    background-color: #ff5e5e;
    border: 2px solid #ff5e5e;
    color: #fff;
    font-size: 24px;
}

/* Hover and active state */
#audio-controls .circle-button:hover {
    transform: scale(1.05);
}

#audio-controls .circle-button:active {
    transform: scale(0.95);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

/* ========== Status / Loading ========== */
#status-message {
    font-style: italic;
    color: #888;
    text-align: center;
}

#loading-animation {
    color: #00ffc3;
    font-weight: bold;
    animation: pulse 1.2s infinite;
    text-align: center;
}

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

/* ========== Responsive Layout ========== */
@media (max-width: 480px) {
    main {
        padding: 16px;
    }

    #call-link-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    #call-link-container input,
    #call-link-container button,
    button {
        width: 100%;
    }

    #audio-controls .call-actions {
        flex-direction: row;
        justify-content: space-evenly;
    }
}
