:root {
    --primary-color: #007bff; /* Blue */
    --primary-dark: #0056b3;
    --secondary-color: #6c757d; /* Gray */
    --secondary-dark: #5a6268;
    --accent-color: #f37623; /* AFTVnews Orange */
    --background-light: #f4f7f6;
    --text-dark: #333;
    --text-medium: #666;
    --text-light: #999;
    --border-color: #ddd;
    --error-color: #dc3545;
    --success-bg: #e6ffed; /* Lighter success background */
    --success-text: #28a745; /* Darker success text */
    --box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

body {
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-light);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 1rem;
    box-sizing: border-box;
    color: var(--text-dark);
}

.container {
    background: #fff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    text-align: center;
    max-width: 550px; /* Increased max-width for better content display */
    width: 100%;
    transition: all 0.3s ease-in-out;
}

.hero-section {
    margin-bottom: 2rem;
}

h1 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.2;
}

.description {
    color: var(--text-medium);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.how-it-works {
    background-color: #f0f8ff; /* Light blue background for instructions */
    border: 1px solid #cceeff;
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1.5rem;
}

.how-it-works h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 0.8rem;
}

.how-it-works p {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-medium);
    margin-bottom: 0;
}

.form-section {
    margin-top: 2rem;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

input[type="url"], input[type="text"] {
    padding: 1rem 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.1rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="url"]:focus, input[type="text"]:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(243, 118, 35, 0.25); /* Accent color shadow */
}

button {
    padding: 1rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}

button:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-secondary {
    background-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.2);
}

.error {
    color: var(--error-color);
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    font-size: 1rem;
    font-weight: 500;
}

.result-box {
    margin-top: 2rem;
    padding: 1.8rem;
    background-color: var(--success-bg);
    border-radius: 12px;
    border: 1px solid var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.1);
}

.result-label {
    margin-bottom: 0.5rem;
    color: var(--text-medium);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.result-code {
    font-size: 3.5rem; /* Larger font size for code */
    font-weight: 700;
    color: var(--accent-color); /* Accent color for the code */
    margin: 1rem 0 1.5rem;
    letter-spacing: 3px;
    word-break: break-all;
    background-color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px dashed #ccc;
    display: inline-block; /* To make padding effective */
}

.result-url {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
    font-size: 1.1rem;
}

.result-url:hover {
    text-decoration: underline;
}

.divider {
    margin: 2.5rem 0;
    font-weight: 600;
    color: var(--text-light);
    position: relative;
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 1px;
}

.divider::before, .divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 30%; /* Adjust width */
    height: 1px;
    background: var(--border-color);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

/* Adaptação para TVs e Telas Maiores */
@media (min-width: 768px) {
    body {
        padding: 2rem;
    }

    .container {
        max-width: 700px; /* Even larger max-width for TVs */
        padding: 4rem;
    }

    h1 {
        font-size: 3.2rem;
        margin-bottom: 1.5rem;
    }

    .description {
        font-size: 1.3rem;
        margin-bottom: 2rem;
    }

    .how-it-works h2 {
        font-size: 1.8rem;
    }

    .how-it-works p {
        font-size: 1.2rem;
    }

    input[type="url"], input[type="text"], button {
        padding: 1.3rem 2rem;
        font-size: 1.3rem;
    }

    .result-box {
        padding: 2.5rem;
    }

    .result-code {
        font-size: 4.5rem;
        padding: 0.8rem 1.5rem;
    }

    .result-url {
        font-size: 1.3rem;
    }

    .divider {
        font-size: 1.2rem;
        margin: 3rem 0;
    }

    .error {
        font-size: 1.2rem;
    }
}

/* Adaptação para telas muito grandes (TVs 4K) */
@media (min-width: 1200px) {
    .container {
        max-width: 900px;
        padding: 5rem;
    }

    h1 {
        font-size: 4rem;
    }

    .description {
        font-size: 1.5rem;
    }

    .how-it-works h2 {
        font-size: 2.2rem;
    }

    .how-it-works p {
        font-size: 1.4rem;
    }

    input[type="url"], input[type="text"], button {
        font-size: 1.5rem;
    }

    .result-code {
        font-size: 5.5rem;
    }

    .result-url {
        font-size: 1.5rem;
    }

    .divider {
        font-size: 1.4rem;
    }
}
