/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --primary-color: #033a7c;
    --primary-gradient: linear-gradient(135deg, #033a7c 0%, #6db967 100%);
    --secondary-color: #1e1b4b;
    --background-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.3);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: #f0f4f8;
    background-image:
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(124, 58, 237, 0.1) 0px, transparent 50%);
    color: var(--text-color);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* NAVIGATION */
.nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem;
    margin-bottom: 3rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-radius: 9999px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
}

.nav a:hover,
.nav a.active {
    color: var(--primary-color);
    background: #eef2ff;
}

/* CARDS */
.card {
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* HEADER STYLE */
h1 {
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-top: 0;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2.25rem;
    text-align: center;
}

p.subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* CODE DISPLAY HERO */
.hero-section {
    text-align: center;
    padding: 2rem 0;
}

.code-display {
    font-size: 18rem;
    font-weight: 800;
    color: #033a7c;
    line-height: 1;
    margin: 1rem 0;
    text-shadow: 2px 4px 0 rgba(79, 70, 229, 0.1);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5rem;
    position: relative;
    display: inline-block;
    z-index: 10;
}

/* Efeito de brilho atrás do código */
.code-display::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(22, 233, 68, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    z-index: -1;
    border-radius: 50%;
}

.date-badge {
    display: inline-block;
    background: #f1f5f9;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 2rem;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
}

.date-badge strong {
    color: var(--text-color);
}

/* INPUTS */
input[type="text"],
input[type="date"],
input[type="email"],
input[type="password"] {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-color);
    background: #f8fafc;
    transition: all 0.2s;
    outline: none;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(3, 58, 124, 0.1);
}

/* UTILS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #f8fafc;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 8px;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* MODERN TABS */
.tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    background: white;
    padding: 0.5rem;
    border-radius: 99px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
    /* Para mobile */
}

.tab-link {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    border-radius: 99px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
}

.tab-link:hover {
    color: var(--primary-color);
    background: #f8fafc;
}

.tab-link.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    background: #f8fafc;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: white;
}

tr:last-child td {
    border-bottom: none;
}

.badge {
    padding: 0.35em 0.8em;
    border-radius: 99px;
    font-size: 0.75em;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.badge-used {
    background-color: #e0e7ff;
    color: #3730a3;
}

.badge-available {
    background-color: #dcfce7;
    color: #166534;
}

/* SEARCH BOX ADMIN */
.search-box {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
}

/* LOGOS */
.logo-header {
    max-width: 150px;
    height: auto;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* FOOTER */
.main-footer {
    text-align: center;
    margin-top: 3rem;
    padding-bottom: 2rem;
    color: var(--text-muted);
}

.main-footer p {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.logo-footer {
    max-width: 120px;
    height: auto;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
}

/* PRINT STYLES */
@media print {
    @page {
        size: A4;
        margin: 2cm;
    }

    body {
        background: white;
        color: black;
        display: block;
        padding: 0;
    }

    .container {
        max-width: 100%;
        margin: 0;
        box-shadow: none;
    }

    .card {
        box-shadow: none;
        border: 2px solid #000;
        padding: 2rem;
        margin: 0;
        border-radius: 0;
    }

    /* Hide unnecessary elements */
    .nav,
    .btn,
    .search-box,
    .tabs,
    .hero-section button,
    div[style*="margin-top: 1rem"] {
        display: none !important;
    }

    /* Adjust sizes for print */
    .logo-header {
        max-width: 200px;
        /* Maior para impressão */
        filter: grayscale(100%);
        /* Opcional: economizar tinta colorida */
    }

    h1 {
        font-size: 3rem;
        color: black;
        -webkit-text-fill-color: black;
        background: none;
    }

    .subtitle {
        font-size: 1.5rem;
        color: #333;
    }

    .code-display {
        font-size: 12rem;
        /* Bem grande na folha */
        border: 4px solid #000;
        color: black;
        text-shadow: none;
        background: white;
    }

    .code-display::after {
        display: none;
        /* Remove glow */
    }

    .date-badge {
        font-size: 2rem;
        border: 1px solid #000;
        background: white;
        color: black;
    }

    .date-badge strong {
        color: black;
    }

    .main-footer {
        position: fixed;
        bottom: 0;
        width: 100%;
        margin: 0;
        padding: 1rem;
    }

    .logo-footer {
        filter: grayscale(100%);
    }
}

/* RESPONSIVE STYLES */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .code-display {
        font-size: 6rem;
        letter-spacing: 0.2rem;
        margin: 0.5rem 0;
    }

    .date-badge {
        font-size: 1.25rem;
        padding: 0.4rem 0.8rem;
    }

    .nav {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .logo-header {
        max-width: 120px;
    }

    .search-box {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }

    .search-group {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        align-self: stretch !important;
        /* Override layout inline styles */
    }

    .search-group input {
        width: 100%;
    }

    .search-group .btn,
    .search-group .btn-secondary {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .code-display {
        font-size: 12rem;
        letter-spacing: 0.1rem;
    }

    .hero-section button {
        width: 100%;
        justify-content: center;
    }

    .hero-section>div[style*="display: flex"] {
        flex-direction: column;
        width: 100%;
    }
}