@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

/* --- NEUMORPHIC / SOFT UI THEME ---
 * A complete redesign focusing on a soft, tactile user interface.
 * Elements appear to extrude from or be pressed into the background.
*/

:root {
    --bg-color: #e0e5ec;
    --text-color: #5b6371;
    --accent-color: #4a77e2;
    --accent-dark: #3c61b6;
    --accent-light: #588dff;
    --shadow-dark: #babecc;
    --shadow-light: #ffffff;
    --success-color: #2ecc71;
    --error-color: #e74c3c;
}

body { /* Added to demonstrate the background effect */
    background-color: var(--bg-color);
}

.ytm-converter-wrapper {
    font-family: 'Roboto', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    padding: 30px 40px;
    border-radius: 20px;
    /* Main Neumorphic effect for the container */
    box-shadow: 10px 10px 20px var(--shadow-dark), -10px -10px 20px var(--shadow-light);
    max-width: 650px;
    margin: 40px auto;
    overflow: hidden;
}

.ytm-inner h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--text-color);
    text-shadow: 1px 1px 1px var(--shadow-light);
}

.ytm-inner h2 .fab.fa-youtube {
    color: #ff0000;
    margin-right: 10px;
}

.ytm-subtitle {
    text-align: center;
    font-size: 1rem;
    margin-bottom: 30px;
    color: var(--text-color);
}

.ytm-input-group {
    display: flex;
    gap: 15px;
}

#ytm-url-input {
    flex-grow: 1;
    padding: 14px 18px;
    font-size: 1rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    border-radius: 10px;
    border: none;
    transition: box-shadow 0.3s ease;
    /* Inset shadow to make it look "pressed in" */
    box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
}

#ytm-url-input:focus {
    outline: none;
    /* Enhance the pressed effect on focus */
    box-shadow: inset 7px 7px 15px var(--shadow-dark), inset -7px -7px 15px var(--shadow-light);
}

#ytm-fetch-btn {
    padding: 14px 25px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent-color);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    /* Extruded button effect */
    box-shadow: 5px 5px 10px var(--accent-dark), -5px -5px 10px var(--accent-light);
}

#ytm-fetch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 7px 7px 15px var(--accent-dark), -7px -7px 15px var(--accent-light);
}

#ytm-fetch-btn:active {
    transform: translateY(1px);
    /* "Pressed in" effect on click */
    box-shadow: inset 3px 3px 7px var(--accent-dark), inset -3px -3px 7px var(--accent-light);
}

/* --- All other elements are styled to match the new theme --- */

.ytm-video-info {
    margin-top: 30px;
    display: flex;
    gap: 20px;
    padding: 20px;
    border-radius: 15px;
    box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
}

#ytm-thumbnail {
    width: 160px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
}

.ytm-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

#ytm-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    line-height: 1.4;
    color: var(--text-color);
}

.ytm-quality-options h4 {
    font-size: 0.9rem;
    margin: 0 0 8px 0;
    color: var(--text-color);
}

.ytm-status {
    margin-top: 25px;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    display: none;
    font-weight: 700;
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
}

.ytm-status.success, .ytm-status.error, .ytm-status.loading {
    display: block;
    color: #fff;
}

.ytm-status.success {
    background: var(--success-color);
}

.ytm-status.error {
    background: var(--error-color);
}

.ytm-status.loading {
    background: var(--accent-color);
}

.ytm-status p {
    margin: 0 0 10px 0;
}

.ytm-download-btn, #ytm-convert-btn {
    display: inline-block;
    padding: 12px 25px;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    transition: all 0.2s ease-in-out;
    border: none;
    cursor: pointer;
}

#ytm-convert-btn {
    background: var(--accent-color);
    box-shadow: 3px 3px 8px var(--accent-dark), -3px -3px 8px var(--accent-light);
}

.ytm-download-btn {
    background-color: var(--success-color);
    box-shadow: 3px 3px 8px #27ae60, -3px -3px 8px #35f884;
}

#ytm-convert-btn:hover, .ytm-download-btn:hover {
    transform: translateY(-2px);
}
#ytm-convert-btn:active, .ytm-download-btn:active {
    transform: translateY(1px);
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    .ytm-converter-wrapper {
        padding: 20px;
        margin: 20px;
    }
    .ytm-input-group {
        flex-direction: column;
    }
    .ytm-video-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .ytm-details {
        width: 100%;
    }
}