/* styles.css */

/* General Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Roboto", sans-serif;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 800px;
    width: 100%;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-top: 20px;
    margin-bottom: 40px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: #2c3e50;
    font-size: 2.8em;
    margin-bottom: 10px;
    font-family: "Cairo", sans-serif;
}

.tagline {
    color: #7f8c8d;
    font-size: 1.1em;
}

/* Controls Section */
.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    gap: 15px;
}

.select-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px;
}

select {
    appearance: none;
    padding: 12px 35px 12px 15px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #bdc3c7;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    width: 100%;
    cursor: pointer;
}

.select-arrow {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #7f8c8d;
    pointer-events: none;
}

.button-group {
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

button {
    padding: 14px 28px;
    font-size: 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    flex-grow: 1;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button svg {
    width: 20px;
    height: 20px;
}

button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(1px);
}

button:disabled {
    background-color: #83878a;
    cursor: not-allowed;
    transform: none;
}

.listen-button {
    background-color: #2ecc71;
}

.listen-button:hover:not(:disabled) {
    background-color: #27ae60;
}

.clear-button {
    background-color: #e74c3c;
}

.clear-button:hover:not(:disabled) {
    background-color: #c0392b;
}


/* Microphone Icon Styles */
.listen-button .icon {
    display: flex;
    width: 24px;
    height: 24px;
}

.listen-button .icon svg {
    width: 100%;
    height: 100%;
    transition: transform 0.2s ease;
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes wave {
    0%, 100% {
        height: 12px;
    }

    50% {
        height: 24px;
    }
}

.listen-button.listening {
    animation: pulse 1.5s infinite;
    -webkit-animation: pulse 1.5s infinite;
}

.listen-button.listening .icon svg {
    animation: pulse 1.5s infinite;
    -webkit-animation: pulse 1.5s infinite;
}

/* Wave Animation */
.listen-button .wave {
    display: none;
    gap: 3px;
    margin-left: 8px;
}

.listen-button.listening .wave {
    display: flex;
}

.wave-bar {
    width: 4px;
    height: 12px;
    background: rgba(255, 255, 255, 0.8);
    animation: wave 1s ease-in-out infinite;
    -webkit-animation: wave 1s ease-in-out infinite;
}

.wave-bar:nth-child(1) {
    animation-delay: 0.1s;
}

.wave-bar:nth-child(2) {
    animation-delay: 0.3s;
}

.wave-bar:nth-child(3) {
    animation-delay: 0.5s;
}


/* Status Message */
.status-message {
    font-size: 0.9em;
    color: #3498db;
    margin-top: 8px;
    font-weight: 500;
}

/* Result Section */
.result-container {
    margin-top: 20px;
    background-color: #ecf0f1;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.result-text {
    font-size: 1.15em;
    min-height: 150px;
    padding: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #555;
    text-align: left;
    font-family: "Roboto", sans-serif;
    line-height: 1.7;
    outline: none;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 20px;
        margin-top: 10px;
        margin-bottom: 20px;
    }

    h1 {
        font-size: 2.2em;
        margin-bottom: 15px;
    }

    .controls {
        gap: 10px;
        margin-bottom: 20px;
    }

    .button-group {
        flex-direction: column;
        gap: 8px;
    }

    button {
        width: 100%;
        min-width: auto;
        padding: 12px 24px;
        font-size: 15px;
    }

    select {
        font-size: 15px;
        padding: 10px 30px 10px 12px;
    }

    .result-text {
        font-size: 1.1em;
        min-height: 120px;
        padding: 12px;
    }

    footer {
        margin-top: 30px;
        font-size: 0.7em;
    }

    /* Mobile adjustments for wave animation */
    .wave-bar {
        width: 3px;
        height: 10px;
    }
}