/* Forms and Output Console Styles - Shared by Index and Help pages */
/* Note: Base variables are in common.css */

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

/* ==========================================================================
   Login & Register Form Container
   ========================================================================== */
.form-container {
    max-width: 400px;
    margin: 80px auto;
    padding: 40px;
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.form-container h2 {
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 30px;
}

.form-container .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: all var(--transition-normal);
    box-sizing: border-box;
}

.form-container .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-container .btn {
    width: 100%;
    padding: 12px 16px;
    margin-top: 10px;
    font-weight: 600;
    border-radius: var(--radius-md);
}

.form-container a {
    color: var(--primary-color);
    transition: color var(--transition-normal);
}

.form-container a:hover {
    color: var(--primary-hover);
}

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

/* ==========================================================================
   yt-dlp 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 40px 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    font-size: 18px;
    min-height: 30px;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#ytdl-form input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    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: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    margin: 0 5px;
    font-size: 18px;
    font-weight: 500;
    transition: all var(--transition-normal);
    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: var(--primary-hover);
    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
   ========================================================================== */
.btn-stop {
    position: absolute;
    top: 10px;
    left: 15px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-stop:hover {
    background: rgba(220, 53, 69, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-stop:active {
    transform: translateY(0);
}

.btn-stop i {
    margin-right: 6px;
    font-size: 14px;
}

.console-wrapper {
    position: relative;
    margin: 30px auto;
    max-width: 95%;
}

#output {
    position: relative;
    margin: 0;
    max-width: 100%;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    white-space: normal;
    background-color: #1e1e1e;
    color: #0f0;
    padding: 0;
    border-radius: var(--radius-md);
    transition: max-height var(--transition-normal), padding var 0.3s ease;
    overflow-x: auto;
    word-break: break-all;
    box-shadow: var(--shadow-md);
    border: 1px solid #333;
}

#output span {
    white-space: pre-wrap;
}

#output.show {
    padding: 20px;
}

#output.has-toolbar.show {
    padding-top: 50px;
}

#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 var(--primary-color);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow var(--transition-normal);
}

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

/* ==========================================================================
   Responsive Styles
   ========================================================================== */
@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;
        flex-wrap: wrap;
    }

    #ytdl-form .button-row>* {
        flex: 1;
    }

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

@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;
    }
}

@media (max-width: 768px) {

    #ytdl-form .form-row,
    #ytdl-form .preset-row {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

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

    #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;
    }

    .console-wrapper,
    #description {
        margin-left: 15px;
        margin-right: 15px;
    }
}

/* ==========================================================================
   Dark Mode - Forms
   ========================================================================== */
[data-bs-theme="dark"] {
    body {
        background-color: var(--bg-body-default);
    }

    .form-container {
        background-color: #1a1a1a;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .form-container h2 {
        color: var(--text-main);
    }

    .form-container .form-control {
        background-color: #2d2d2d;
        border-color: #404040;
        color: var(--text-main);
    }

    .form-container .form-control:focus {
        background-color: #2d2d2d;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
    }

    .form-container a {
        color: #66bb6a;
    }

    .form-container a:hover {
        color: #81c784;
    }

    h1 {
        color: var(--text-main);
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }

    #ytdl-form .form-label {
        color: #b0b0b0;
    }

    #ytdl-form input[type="text"] {
        background-color: #2d2d2d;
        border-color: #404040;
        color: var(--text-main);
    }

    #ytdl-form input[type="text"]:focus {
        background-color: #2d2d2d;
        border-color: var(--primary-color);
    }

    #output {
        background-color: #1a2332;
        border-color: #2a3a4a;
        color: #00ff00;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }

    #output a {
        color: #ffff00;
    }

    #description {
        background-color: #1a1a1a;
        border-color: #404040;
        border-left-color: var(--primary-color);
        color: var(--text-main);
    }

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