/* ===================================
   ESTILOS RESPONSIVOS - FUNDO MÁGICO
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* MOBILE FIRST - Pequenas telas (até 480px) */
body {
    background-color: #0f131a;
    color: #ffffff;
    background: url(../src/images/bg.JPG);
    background-size: cover;
    background-attachment: fixed;
    font-family: 'Roboto Mono', monospace;
    line-height: 1.4;
    padding: 16px 12px;
    min-height: 100vh;
}

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

.header h1 {
    margin-bottom: 12px;
    font-size: 28px;
    font-weight: 700;
}

.header .subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    max-width: 100%;
    margin: 0 auto;
    line-height: 1.6;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 99;
    padding: 0;
}

.card {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    background-color: rgba(15, 19, 26, 0.8);
    backdrop-filter: blur(10px);
}

.card-header {
    text-align: center;
    margin-bottom: 24px;
    font-size: 16px;
    font-weight: 600;
}

.form-group {
    width: 100%;
}

.form-group textarea {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    width: 100%;
    min-height: 100px;
    border: 1px solid #474646;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    padding: 12px;
    font-family: 'Roboto Mono', monospace;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: #a655f7;
    background-color: rgba(255, 255, 255, 0.08);
}

.form-group textarea::placeholder {
    color: #a19e9e;
}

.form-group .btn-magic {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(90deg, #a655f7 0%, #ff80aa 100%);
    color: #ffffff;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group .btn-magic:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(166, 85, 247, 0.4);
}

.form-group .btn-magic:active {
    transform: translateY(0);
}

.preview-card {
    display: none;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    min-height: 200px;
}

.preview-card.active {
    display: block;
}

.code-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.code-card {
    background-color: #21242a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    width: 100%;
}

.code-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #a655f7;
}

.code-block {
    background-color: rgba(0, 0, 0, 0.3);
    color: #00ff00;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.5;
    font-family: 'Courier New', monospace;
}

/* TABLETS - Telas médias (481px a 768px) */
@media (min-width: 481px) {
    body {
        padding: 24px 16px;
    }

    .header {
        margin-bottom: 40px;
    }

    .header h1 {
        font-size: 36px;
        margin-bottom: 14px;
    }

    .header .subtitle {
        font-size: 15px;
        max-width: 600px;
    }

    .container {
        max-width: 720px;
        margin: 0 auto;
        padding: 0;
    }

    .card {
        padding: 24px;
        margin-bottom: 24px;
    }

    .card-header {
        font-size: 18px;
        margin-bottom: 28px;
    }

    .form-group textarea {
        min-height: 120px;
        font-size: 15px;
        padding: 14px;
    }

    .form-group .btn-magic {
        padding: 15px 28px;
        font-size: 15px;
    }

    .code-block {
        font-size: 13px;
        padding: 14px;
    }
}

/* DESKTOP PEQUENO - Telas grandes (769px a 1024px) */
@media (min-width: 769px) {
    body {
        padding: 32px 24px;
    }

    .header {
        margin-bottom: 48px;
    }

    .header h1 {
        font-size: 44px;
        margin-bottom: 16px;
    }

    .header .subtitle {
        font-size: 17px;
        max-width: 700px;
    }

    .container {
        max-width: 1024px;
        margin: 0 auto;
    }

    .card {
        padding: 32px;
        margin-bottom: 32px;
    }

    .card-header {
        font-size: 20px;
        margin-bottom: 32px;
    }

    .form-group textarea {
        min-height: 140px;
        font-size: 16px;
        padding: 16px;
    }

    .form-group .btn-magic {
        padding: 16px 32px;
        font-size: 16px;
    }

    .preview-card {
        min-height: 300px;
    }

    .code-grid {
        flex-direction: row;
        gap: 24px;
    }

    .code-card {
        width: 50%;
        padding: 24px;
    }

    .code-block {
        font-size: 14px;
        padding: 16px;
    }
}

/* DESKTOP GRANDE - Telas muito grandes (1025px+) */
@media (min-width: 1025px) {
    body {
        padding: 40px 32px;
    }

    .header h1 {
        font-size: 48px;
    }

    .header .subtitle {
        font-size: 19px;
    }

    .container {
        max-width: 1200px;
    }

    .card {
        padding: 40px;
    }

    .card-header {
        font-size: 22px;
    }

    .form-group textarea {
        min-height: 160px;
        font-size: 17px;
    }

    .form-group .btn-magic {
        padding: 18px 36px;
        font-size: 17.6px;
    }

    .form-group .btn-magic:hover {
        box-shadow: 0 12px 24px rgba(166, 85, 247, 0.5);
    }

    .preview-card {
        min-height: 400px;
    }
}

/* ORIENTAÇÃO - Modo Paisagem em Dispositivos Pequenos */
@media (max-height: 600px) and (orientation: landscape) {
    .header {
        margin-bottom: 20px;
    }

    .header h1 {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .card {
        padding: 16px;
        margin-bottom: 16px;
    }
}

/* ACESSIBILIDADE - Modo Reduzir Movimento */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .form-group .btn-magic:hover {
        transform: none;
    }
}

/* MODO ESCURO - Preferência do Sistema */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #0f131a;
    }

    .card {
        background-color: rgba(15, 19, 26, 0.9);
    }
}

/* IMPRESSÃO */
@media print {
    body {
        background: white;
        color: black;
    }

    .header {
        page-break-after: avoid;
    }

    .card {
        page-break-inside: avoid;
        border: 1px solid black;
    }
}
