/* =========================================================================
   Reset e Base
   ========================================================================= */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.6;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* =========================================================================
   Navbar
   ========================================================================= */

.navbar {
    background: #1a1a2e;
    color: #fff;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-links a {
    color: #94a3b8;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
}

.nav-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #94a3b8;
}

/* =========================================================================
   Container
   ========================================================================= */

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

/* =========================================================================
   Botoes
   ========================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-primary:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

.btn-outline {
    background: transparent;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

.btn-outline:hover {
    background: #f1f5f9;
    color: #334155;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-full {
    width: 100%;
}

/* =========================================================================
   Formularios
   ========================================================================= */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #9ca3af;
}

/* =========================================================================
   Alertas
   ========================================================================= */

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* =========================================================================
   Login
   ========================================================================= */

.login-page {
    background: #1a1a2e;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 16px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-card h1 {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.login-subtitle {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 32px;
}

/* =========================================================================
   Grid de Modelos
   ========================================================================= */

.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.model-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s, transform 0.2s;
}

.model-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.model-screenshot {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #e5e7eb;
}

.model-screenshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.model-info {
    padding: 16px 20px 8px;
}

.model-info h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 6px;
}

.model-info p {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 8px;
}

.model-preview-link {
    font-size: 13px;
    color: #2563eb;
}

.model-actions {
    padding: 12px 20px 20px;
}

/* =========================================================================
   Modal
   ========================================================================= */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: #374151;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* =========================================================================
   Progresso do Deploy
   ========================================================================= */

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    background: #2563eb;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 20px;
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.step {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #9ca3af;
    background: #f9fafb;
    transition: all 0.3s;
}

.step-active {
    color: #2563eb;
    background: #eff6ff;
    font-weight: 600;
}

.step-completed {
    color: #16a34a;
    background: #f0fdf4;
}

.step-completed::before {
    content: '\2713 ';
    font-weight: bold;
}

.step-active::before {
    content: '\25B6 ';
}

/* =========================================================================
   Resultado do Deploy
   ========================================================================= */

.result-success {
    text-align: center;
}

.result-success h4 {
    font-size: 20px;
    color: #16a34a;
    margin-bottom: 16px;
}

.result-error h4 {
    font-size: 20px;
    color: #dc2626;
    margin-bottom: 12px;
}

.result-error p {
    color: #64748b;
    font-size: 14px;
    background: #fef2f2;
    padding: 12px;
    border-radius: 8px;
}

.credentials-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    text-align: left;
    margin-top: 12px;
}

.credentials-box p {
    font-size: 14px;
    margin-bottom: 8px;
    color: #374151;
}

.credentials-box hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 12px 0;
}

.credentials-box a {
    color: #2563eb;
    word-break: break-all;
}

/* =========================================================================
   Historico
   ========================================================================= */

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-form input {
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    width: 240px;
}

.search-form input:focus {
    outline: none;
    border-color: #2563eb;
}

.table {
    width: 100%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-collapse: collapse;
}

.table th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e5e7eb;
}

.table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #374151;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: #f8fafc;
}

/* =========================================================================
   Badges
   ========================================================================= */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-error {
    background: #fef2f2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* =========================================================================
   Paginacao
   ========================================================================= */

.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}

/* =========================================================================
   Utilitarios
   ========================================================================= */

.empty-state {
    text-align: center;
    color: #9ca3af;
    padding: 60px 20px;
    font-size: 16px;
}

h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
}

/* =========================================================================
   Responsivo
   ========================================================================= */

@media (max-width: 768px) {
    .models-grid {
        grid-template-columns: 1fr;
    }

    .navbar {
        padding: 0 12px;
        gap: 12px;
    }

    .nav-links a {
        padding: 6px 10px;
        font-size: 13px;
    }

    .history-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-form input {
        width: 180px;
    }

    .table {
        font-size: 13px;
    }

    .table th,
    .table td {
        padding: 8px 10px;
    }
}
