/* RESET BÁSICO */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

/* VARIÁVEIS DE COR (TEMA ESCURO DA PIPELINE) */
:root {
    --bg-dark: #0f172a;       /* Slate 900 */
    --card-bg: #1e293b;       /* Slate 800 */
    --input-bg: #0f172a;      /* Slate 900 */
    --border-color: #334155;  /* Slate 700 */
    --text-main: #ffffff;
    --text-muted: #94a3b8;     /* Slate 400 */
    --text-subtle: #64748b;    /* Slate 500 */
    
    --primary: #2563eb;        /* Blue 600 */
    --primary-hover: #1d4ed8;  /* Blue 700 */
    --primary-glow: rgba(37, 99, 235, 0.3);
    
    --success-bg: rgba(34, 197, 94, 0.15);
    --success-text: #4ade80;
    --success-border: rgba(34, 197, 94, 0.3);
    
    --error-bg: rgba(239, 68, 68, 0.15);
    --error-text: #f87171;
    --error-border: rgba(239, 68, 68, 0.3);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
}

/* PÁGINA DE LOGIN (CENTRALIZADO) */
.page-center {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* CARDS E PAINÉIS */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.login-card {
    max-width: 28rem;
}

.publisher-container {
    max-width: 48rem;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* CABEÇALHOS E TEXTOS */
.header-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.header-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

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

/* FORMULÁRIOS E INPUTS */
.form-group {
    margin-bottom: 1.25rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    row-gap: 1.25rem;   /* Espaço entre a linha de cima e a de baixo */
    column-gap: 1rem;   /* Espaço entre o select da esquerda e o da direita */
}

.input-field, .select-field {
    width: 100%;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.input-field:focus, .select-field:focus {
    border-color: var(--primary);
}

/* BOTÕES */
.btn-primary {
    width: 100%;
    background-color: var(--primary);
    color: var(--text-main);
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 10px 15px -3px var(--primary-glow);
}

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

.btn-disabled {
    width: 100%;
    background-color: #334155;
    color: var(--text-subtle);
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: none;
    cursor: not-allowed;
    font-size: 0.875rem;
}

/* DRAG AND DROP ZONE */
.drop-zone {
    border: 2px dashed #475569;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    background-color: rgba(15, 23, 42, 0.5);
    transition: border-color 0.2s, background-color 0.2s;
    margin: 20px auto;
}

.drop-zone:hover {
    border-color: var(--primary);
    background-color: rgba(15, 23, 42, 0.8);
}

.drop-text-main {
    font-size: 0.875rem;
    font-weight: 500;
    color: #cbd5e1;
}

.drop-text-link {
    color: #60a5fa;
    text-decoration: underline;
}

.drop-text-sub {
    font-size: 0.75rem;
    color: var(--text-subtle);
    margin-top: 0.5rem;
}

/* CARD DE STATUS E VALIDAÇÃO DE ARQUIVO */
.file-info-card {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.file-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-name {
    font-size: 0.875rem;
    font-weight: 600;
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.badge {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 0.25rem;
}

.badge-success {
    background-color: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

.badge-error {
    background-color: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
}

.validation-msg {
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.validation-msg.success { color: var(--success-text); }
.validation-msg.error { color: var(--error-text); }

/* NAVEGAÇÃO / LAYOUT DE TOPO */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.nav-link {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
}

.nav-link:hover { color: var(--text-main); }

.hidden { display: none !important; }

/* Estilos complementares para ações nos itens de arquivo */
        .file-item-actions {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .btn-icon {
            background: transparent;
            border: none;
            cursor: pointer;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            font-size: 0.9rem;
            transition: background 0.2s;
        }
        .btn-icon:hover {
            background: rgba(255, 255, 255, 0.1);
        }
        .btn-delete {
            color: #ef4444;
        }
        .btn-edit {
            color: #3b82f6;
        }
        .edit-container {
            display: flex;
            gap: 0.5rem;
            margin-top: 0.5rem;
        }
        .input-rename {
            background: #1e293b;
            border: 1px solid #475569;
            color: #fff;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            width: 100%;
            font-size: 0.85rem;
        }
        .btn-save-rename {
            background: var(--primary, #3b82f6);
            color: #fff;
            border: none;
            padding: 0.25rem 0.75rem;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.85rem;
        }

        /* --- ESTILOS DA PRÉVIA (PREVIEW) --- */
        .file-preview-container {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            cursor: pointer;
        }
        .file-preview-thumb {
            width: 44px;
            height: 44px;
            border-radius: 6px;
            object-fit: cover;
            border: 1px solid #475569;
            background-color: #0f172a;
        }
        .file-preview-icon {
            width: 44px;
            height: 44px;
            border-radius: 6px;
            border: 1px solid #475569;
            background-color: #1e293b;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 0.75rem;
            color: #94a3b8;
            text-transform: uppercase;
        }
        .file-preview-icon.psd { color: #38bdf8; border-color: #0284c7; }
        .file-preview-icon.zip { color: #facc15; border-color: #ca8a04; }

        /* --- MODAL / LIGHTBOX DE IMAGEM --- */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(15, 23, 42, 0.85);
            backdrop-filter: blur(4px);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 1000;
            opacity: 1;
            transition: opacity 0.2s ease;
        }
        .modal-overlay.hidden {
            display: none;
            opacity: 0;
        }
        .modal-content {
            position: relative;
            max-width: 85vw;
            max-height: 80vh;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        .modal-img {
            max-width: 100%;
            max-height: 75vh;
            border-radius: 8px;
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
            border: 1px solid #475569;
            object-fit: contain;
        }
        .modal-caption {
            margin-top: 0.75rem;
            color: #f8fafc;
            font-size: 0.9rem;
            font-weight: 500;
        }
        .modal-close {
            position: absolute;
            top: -12px;
            right: -12px;
            background: #ef4444;
            color: #fff;
            border: none;
            border-radius: 50%;
            width: 32px;
            height: 32px;
            font-size: 1rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
        }
        .modal-close:hover {
            background: #dc2626;
        }

        /* --- BARRA DE PROGRESSO DO UPLOAD --- */
    .progress-container {
        margin-top: 1rem;
        padding: 1rem;
        background: #1e293b;
        border-radius: 8px;
        border: 1px solid #334155;
    }
    .progress-header {
        display: flex;
        justify-content: space-between;
        margin-bottom: 0.5rem;
        font-size: 0.85rem;
        color: #f8fafc;
    }
    .progress-bar-bg {
        width: 100%;
        height: 10px;
        background-color: #0f172a;
        border-radius: 999px;
        overflow: hidden;
        border: 1px solid #334155;
    }
    .progress-bar-fill {
        height: 100%;
        width: 0%;
        background: linear-gradient(90deg, #3b82f6, #60a5fa);
        border-radius: 999px;
        transition: width 0.2s ease;
    }
    .progress-status {
        margin-top: 0.5rem;
        font-size: 0.75rem;
        color: #94a3b8;
        display: flex;
        justify-content: space-between;
    }

    /* --- NOTIFICAÇÕES TOAST --- */
    .toast-container {
        position: fixed;
        bottom: 20px;
        right: 20px;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        z-index: 2000;
        max-width: 350px;
    }
    .toast {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.85rem 1rem;
        border-radius: 6px;
        background: #1e293b;
        color: #f8fafc;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
        border-left: 4px solid #3b82f6;
        animation: slideIn 0.3s ease forwards;
        font-size: 0.85rem;
    }
    .toast.success { border-left-color: #0b7a34; }
    .toast.error { border-left-color: #ef4444; }
    .toast.warning { border-left-color: #eab308; }
    .toast-close {
        margin-left: auto;
        background: none;
        border: none;
        color: #94a3b8;
        cursor: pointer;
        font-size: 1rem;
    }
    .toast-close:hover { color: #fff; }

    @keyframes slideIn {
        from { transform: translateX(100%); opacity: 0; }
        to { transform: translateX(0); opacity: 1; }
    }
    @keyframes fadeOut {
        from { opacity: 1; transform: translateX(0); }
        to { opacity: 0; transform: translateX(100%); }
    }

    @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
    }

     .navbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem 1.5rem;
            background-color: #1e293b;
            border-bottom: 1px solid #334155;
            border-radius: 8px 8px 0 0;
            margin-bottom: 1.5rem;
        }

        .user-profile {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .user-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid var(--primary, #3b82f6);
            background-color: #0f172a;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 0.9rem;
            color: #f8fafc;
        }

        .user-info {
            display: flex;
            flex-direction: column;
        }

        .user-name {
            margin: 0;
            font-size: 0.9rem;
            font-weight: 600;
            color: #f8fafc;
            line-height: 1.2;
        }

        .user-role {
            margin: 0;
            font-size: 0.75rem;
            color: #94a3b8;
        }

        .btn-logout {
            color: #ef4444;
            text-decoration: none;
            font-size: 0.85rem;
            margin-left: 0.5rem;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            transition: background 0.2s;
        }

        .btn-logout:hover {
            background: rgba(239, 68, 68, 0.1);
        }

        .file-item-actions {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .btn-icon {
            background: transparent;
            border: none;
            cursor: pointer;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            font-size: 0.9rem;
            transition: background 0.2s;
        }
        .btn-icon:hover {
            background: rgba(255, 255, 255, 0.1);
        }
        .btn-delete { color: #ef4444; }
        .btn-edit { color: #3b82f6; }
        
        .edit-container {
            display: flex;
            gap: 0.5rem;
            margin-top: 0.5rem;
        }
        .input-rename {
            background: #1e293b;
            border: 1px solid #475569;
            color: #fff;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            width: 100%;
            font-size: 0.85rem;
        }
        .btn-save-rename {
            background: var(--primary, #3b82f6);
            color: #fff;
            border: none;
            padding: 0.25rem 0.75rem;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.85rem;
        }

        .file-preview-container {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }
        .file-preview-thumb {
            width: 44px;
            height: 44px;
            border-radius: 6px;
            object-fit: cover;
            border: 1px solid #475569;
            background-color: #0f172a;
            cursor: pointer;
            transition: transform 0.2s, border-color 0.2s;
        }
        .file-preview-thumb:hover {
            transform: scale(1.05);
            border-color: var(--primary, #3b82f6);
        }
        .file-preview-icon {
            width: 44px;
            height: 44px;
            border-radius: 6px;
            border: 1px solid #475569;
            background-color: #1e293b;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 0.75rem;
            color: #94a3b8;
            text-transform: uppercase;
        }
        .file-preview-icon.psd { color: #38bdf8; border-color: #0284c7; }
        .file-preview-icon.zip { color: #facc15; border-color: #ca8a04; }

        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(15, 23, 42, 0.85);
            backdrop-filter: blur(4px);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 1000;
            opacity: 1;
            transition: opacity 0.2s ease;
        }
        .modal-overlay.hidden {
            display: none;
            opacity: 0;
        }
        .modal-content {
            position: relative;
            max-width: 85vw;
            max-height: 80vh;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        .modal-img {
            max-width: 100%;
            max-height: 75vh;
            border-radius: 8px;
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
            border: 1px solid #475569;
            object-fit: contain;
        }
        .modal-caption {
            margin-top: 0.75rem;
            color: #f8fafc;
            font-size: 0.9rem;
            font-weight: 500;
        }
        .modal-close {
            position: absolute;
            top: -12px;
            right: -12px;
            background: #ef4444;
            color: #fff;
            border: none;
            border-radius: 50%;
            width: 32px;
            height: 32px;
            font-size: 1rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
        }
        .modal-close:hover { background: #dc2626; }

        /* Overlay escuro com desfoque */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeInModal 0.2s ease forwards;
}

/* Card central */
.custom-modal-card {
    background: #1e293b;
    border: 1px solid #475569;
    padding: 2rem;
    border-radius: 12px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    animation: scaleUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.custom-modal-icon {
    font-size: 3.2rem;
    margin-bottom: 0.75rem;
}

.custom-modal-card h3 {
    color: #f8fafc;
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.custom-modal-card p {
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 1.5rem 0;
    word-break: break-word;
}

.custom-modal-btn {
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    width: 100%;
    transition: filter 0.2s;
}

.custom-modal-btn:hover {
    filter: brightness(1.15);
}

/* --- ESTILOS TEMÁTICOS DOS ALERTAS CENTRALIZADOS --- */
/* Warning (Aviso/Alerta) */
.custom-modal-card.theme-warning {
    border-color: #f59e0b;
}
.custom-modal-card.theme-warning .custom-modal-btn {
    background: #d97706;
}

/* Error (Erro) */
.custom-modal-card.theme-error {
    border-color: #ef4444;
}
.custom-modal-card.theme-error .custom-modal-btn {
    background: #dc2626;
}

/* Success (Sucesso) */
.custom-modal-card.theme-success {
    border-color: #10b981;
}
.custom-modal-card.theme-success .custom-modal-btn {
    background: #059669;
}

/* Info (Informação) */
.custom-modal-card.theme-info {
    border-color: #3b82f6;
}
.custom-modal-card.theme-info .custom-modal-btn {
    background: #2563eb;
}

#centerAlertIcon {
    margin: 5px auto;
}

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

@keyframes scaleUpModal {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}


.success-animation-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.sketch-check-svg {
    overflow: visible;
}

/* Configuração base para o traço animado */
.sketch-path {
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
    animation: drawSketch 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Delays individuais para dar naturalidade à animação */
.circle-path {
    animation-delay: 0.1s;
    animation-duration: 1.5s;
}

.circle-path-2 {
    animation-delay: 0.8s;
    animation-duration: 1.2s;
    opacity: 0.8;
}

.check-path {
    animation-delay: 1.6s;
    animation-duration: 0.8s;
}

/* Keyframes que simulam a mão a desenhar */
@keyframes drawSketch {
    to {
        stroke-dashoffset: 0;
    }
}

.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeInOverlay 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.custom-modal-card {
    background: #1e293b;
    border: 1px solid #475569;
    padding: 2.2rem 2rem;
    border-radius: 14px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    animation: scaleUpCard 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.custom-modal-icon-container {
    width: 90px;
    height: 90px;
    margin: 0 auto 1rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#centerAlertMessage {
    color: #fff;
}

/* --- ANIMAÇÃO DE DESENHO ESTILO SKETCH (SVG) --- */
.sketch-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawSketch 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.sketch-path-delayed {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawSketch 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.6s forwards;
}

@keyframes drawSketch {
    to {
        stroke-dashoffset: 0;
    }
}

/* Temas Dinâmicos */
.custom-modal-card.theme-success { border-color: rgba(101, 141, 52, 0.5); }
.custom-modal-card.theme-warning { border-color: rgba(217, 119, 6, 0.5); }
.custom-modal-card.theme-error   { border-color: rgba(220, 38, 38, 0.5); }
.custom-modal-card.theme-info    { border-color: rgba(59, 130, 246, 0.5); }

.custom-modal-card h3 {
    color: #f8fafc;
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.custom-modal-card p {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 1.75rem 0;
}

.custom-modal-btn {
    background: #3b82f6;
    color: #ffffff;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
}

.custom-modal-card.theme-success .custom-modal-btn { background: #658d34; }
.custom-modal-card.theme-warning .custom-modal-btn { background: #d97706; }
.custom-modal-card.theme-error .custom-modal-btn   { background: #dc2626; }
.custom-modal-card.theme-info .custom-modal-btn    { background: #2563eb; }

.custom-modal-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

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

@keyframes scaleUpCard {
    from { transform: scale(0.92) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}