@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css');

:root {
    /* Paleta Oficial Purifikar */
    --preto-profundo: #101820;
    --chumbo-metalico: #4B4F54;
    --prata-luxo: #D0D0CE;
    --dourado-solar: #C9A84C;
    --azul-profundo: #203059;
    --azul-royal: #0d4796;

    --radius: 12px;
    
    /* Legado compatibilidade */
    --primary: var(--dourado-solar);
    --bg: var(--preto-profundo);
    --glass: var(--azul-profundo);
    --glass-border: var(--chumbo-metalico);
    --text: #FFFFFF;
    --text-muted: var(--prata-luxo);
    --border: var(--chumbo-metalico);
}

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

body {
    background: var(--preto-profundo);
    color: #FFFFFF;
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
}

/* Header Superior */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 2rem;
    background: var(--azul-profundo);
    border-bottom: 2px solid var(--dourado-solar);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.brand {
    flex: 1;
    align-items: center;
}

.brand img {
    max-width: 180px;
    height: auto;
    transition: all 0.3s;
}

.nav-menu {
    flex: 2;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}
.header-spacer {
    flex: 1;
}

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--prata-luxo);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-item:hover {
    background: rgba(201, 168, 76, 0.1);
    color: var(--dourado-solar);
}

.nav-item.active {
    background: var(--dourado-solar);
    color: var(--preto-profundo);
}

.main-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}


h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff;
    background: none;
    -webkit-text-fill-color: initial;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--dourado-solar);
    color: var(--preto-profundo);
}

.btn-primary:hover {
    background: #e2c063;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(201, 168, 76, 0.3);
}

/* Cards & Stats */
.card {
    background: var(--azul-profundo);
    border: 1px solid var(--chumbo-metalico);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .2);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--azul-profundo);
    border-radius: var(--radius);
    padding: 1.2rem;
    border-top: 3px solid var(--dourado-solar);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .2);
    transition: transform 0.2s;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dourado-solar);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--dourado-solar);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Table */
.table-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--chumbo-metalico);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    color: var(--dourado-solar);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid var(--chumbo-metalico);
}

td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
    font-size: 0.9rem;
}

tr:hover {
    background: rgba(201, 168, 76, 0.05);
}

/* Fix para URLs longas */
td small {
    display: block;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.7;
}

.btn-download {
    color: var(--dourado-solar) !important;
    text-decoration: none;
    font-size: 1.1rem; /* Aumentado para os ícones */
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-download:hover {
    transform: scale(1.2);
    color: #fff !important;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: var(--dourado-solar);
    font-weight: 600;
    text-transform: uppercase;
}

input, select, textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--chumbo-metalico);
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    outline: none;
    transition: border 0.3s ease;
}

input:focus {
    border-color: var(--dourado-solar);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

/* Logo Selector */
.logo-option {
    flex: 1;
}

.logo-preview {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--chumbo-metalico);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.2s;
}

.logo-option input:checked + .logo-preview {
    border-color: var(--dourado-solar);
    background: rgba(201, 168, 76, 0.1);
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
    animation: fadeIn 0.4s ease forwards;
}

/* Modal System (dash.php style) */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeInOverlay 0.3s ease-out;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-box {
    background: var(--azul-profundo);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    animation: slideUpModal 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpModal {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--dourado-solar);
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--dourado-solar);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Modal Options (Radio List) */
.option-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-option:hover {
    background: rgba(212, 175, 55, 0.05);
    border-color: rgba(212, 175, 55, 0.3);
}

.modal-option input {
    margin: 0;
}

.modal-option b {
    display: block;
    color: #fff;
    font-size: 0.95rem;
}

.modal-option span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-confirm {
    background: var(--primary);
    color: var(--preto-profundo);
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
    filter: brightness(1.1);
}

.btn-cancel {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-cancel:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* Badge styles update */
.badge-type {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--dourado-solar);
    font-weight: 600;
    text-transform: uppercase;
}

/* Action Buttons (Icon Only) */
.act-btn-round {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    color: var(--dourado-solar);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
}

.act-btn-round:hover {
    border-color: var(--dourado-solar);
    background: rgba(212,175,55,0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212,175,55,0.2);
}

/* Custom Filter Select */
.filter-dropdown {
    background: var(--azul-profundo);
    border: 1px solid var(--border);
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 160px;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23c9a84c' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
/* Custom Dropdown System */
.custom-select {
    position: relative;
    width: 100%;
}

.select-trigger {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 15px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.select-trigger:hover {
    border-color: var(--dourado-solar);
    background: rgba(201, 168, 76, 0.05);
}

.select-trigger i {
    color: var(--dourado-solar);
    font-size: 1.1rem;
}

.select-trigger .arrow {
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.custom-select.active .arrow {
    transform: rotate(180deg);
}

.select-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: var(--azul-profundo);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1100;
    display: none;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.custom-select.active .select-options {
    display: block;
    animation: slideDownFade 0.2s ease-out;
}

.select-option {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--prata-luxo);
    font-size: 0.9rem;
}

.select-option:hover {
    background: rgba(201, 168, 76, 0.1);
    color: #fff;
}

.select-option i {
    width: 20px;
    text-align: center;
}

@keyframes slideDownFade {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
