/* Forms and Output Console Styles - Shared by Index and Help pages */

/* Page layout */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    margin: 0 auto;
    max-width: 2000px;
    padding: 0 20px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-top: 20px;
    font-weight: 600;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* ============================================
   Form Styles
   ============================================ */

#ytdl-form {
    text-align: center;
    margin-top: 30px;
    padding: 0 15px;
}

#ytdl-form .form-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    margin-left: auto;
    margin-right: auto;
}

#ytdl-form .form-label {
    color: #555;
    font-size: 22px;
    font-weight: 600;
    white-space: nowrap;
    margin: 0;
    flex-shrink: 0;
}

#ytdl-form input[type="text"] {
    flex: 1;
    max-width: 1200px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 18px;
    min-height: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#ytdl-form input[type="text"]:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1), 0 2px 8px rgba(0,0,0,0.1);
}

/* Preset command row styles */
#ytdl-form .preset-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    margin-left: auto;
    margin-right: auto;
}

#ytdl-form .button-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    margin-left: 0;
}

#ytdl-form input[type="submit"],
#ytdl-form input[type="reset"] {
    padding: 12px 24px;
    background-color: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin: 0 5px;
    font-size: 18px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

#ytdl-form input[type="submit"]:hover:not(:disabled),
#ytdl-form input[type="reset"]:hover:not(:disabled) {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

#ytdl-form input[type="submit"]:active:not(:disabled),
#ytdl-form input[type="reset"]:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

#ytdl-form input[type="submit"]:disabled,
#ytdl-form input[type="reset"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #ccc;
    background-image: url('data:image/svg+xml;utf8,<svg width="20" height="20" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="a" x1="8.042%" y1="0%" x2="65.682%" y2="23.865%"><stop stop-color="%23fff" stop-opacity="0" offset="0%"/><stop stop-color="%23fff" stop-opacity=".631" offset="63.146%"/><stop stop-color="%23fff" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><g transform="translate(1 1)"><path d="M36 18c0-9.94-8.06-18-18-18" stroke="url(%23a)" stroke-width="2"><animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="0.8s" repeatCount="indefinite"/></path><circle fill="%23fff" cx="18" cy="18" r="1"/></g></g></svg>');
    background-repeat: no-repeat;
    background-position: 95% center;
}

/* ============================================
   Output Console Styles
   ============================================ */

#output {
    margin: 30px auto;
    max-width: 95%;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    white-space: pre-wrap;
    background-color: #1e1e1e;
    color: #0f0;
    padding: 0;
    border-radius: 8px;
    transition: max-height 0.3s ease-out;
    overflow-x: auto;
    word-break: break-all;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid #333;
}

#output.show {
    padding: 20px;
}

#output a {
    color: #ff0;
}

/* ============================================
   Description Area
   ============================================ */

#description {
    margin: 20px auto;
    max-width: 95%;
    padding: 20px 24px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #4CAF50;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

#description:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* ============================================
   Responsive Styles
   ============================================ */

/* Small screen optimization - fix excessive right margin */
@media (max-width: 500px) {
    body {
        padding: 0 10px;
    }

    h1 {
        font-size: 1.5rem;
        margin-top: 10px;
    }

    #ytdl-form {
        padding: 0 5px;
    }

    #ytdl-form .form-row {
        gap: 5px;
    }

    #ytdl-form .form-label {
        font-size: 16px;
        min-width: 60px;
    }

    #ytdl-form input[type="text"] {
        flex: 1;
        min-width: 0;
        font-size: 14px;
        padding: 8px;
    }

    #ytdl-form .preset-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    #ytdl-form .button-row {
        display: flex;
        width: 100%;
        justify-content: center;
        gap: 8px;
    }

    #ytdl-form input[type="submit"],
    #ytdl-form input[type="reset"] {
        flex: 1;
        min-width: 0;
        font-size: 14px;
        padding: 8px 12px;
    }
}

/* Very small screen optimization - title no wrap */
@media (max-width: 380px) {
    h1 {
        font-size: 1.2rem;
        margin-top: 8px;
    }

    body {
        padding: 0 8px;
    }

    #ytdl-form {
        padding: 0 2px;
    }

    #ytdl-form .form-label {
        font-size: 14px;
        min-width: 50px;
    }

    #ytdl-form input[type="text"] {
        font-size: 13px;
        padding: 6px;
    }

    #ytdl-form input[type="submit"],
    #ytdl-form input[type="reset"] {
        font-size: 13px;
        padding: 6px 10px;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    #ytdl-form .form-row,
    #ytdl-form .preset-row {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    #ytdl-form .form-label {
        font-size: 18px;
    }

    #ytdl-form input[type="text"] {
        font-size: 16px;
        min-width: 150px;
    }

    #ytdl-form input[type="submit"],
    #ytdl-form input[type="reset"] {
        font-size: 16px;
        padding: 8px 16px;
    }

    #output,
    #description {
        margin-left: 15px;
        margin-right: 15px;
    }
}
