@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-primary: #0F172A;
    --bg-card: #1E293B;
    --bg-input: #0F172A;
    --border: #334155;
    --border-hover: #475569;
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --accent-green: #10B981;
    --accent-blue: #3B82F6;
    --accent-purple: #6366F1;
    --accent-pink: #EC4899;
    --accent-red: #EF4444;
    --accent-yellow: #F59E0B;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.25);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.admin-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* ============================================
   HEADER
============================================ */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-back {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.btn-back:hover {
    background: var(--border-hover);
    color: var(--text-primary);
    transform: translateX(-2px);
}

.admin-header h1 {
    font-size: clamp(20px, 4vw, 26px);
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-header h1 i {
    color: var(--accent-purple);
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ============================================
   BOTÕES
============================================ */
.btn-primary, .btn-secondary {
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-green) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

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

.btn-upload {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
}

.btn-upload:hover {
    background: var(--border-hover);
    color: var(--text-primary);
    border-color: var(--accent-purple);
}

.btn-upload-slide {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px dashed var(--border);
    cursor: pointer;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 13px;
}

.btn-upload-slide:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
}

.btn-excluir-slide {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-excluir-slide:hover {
    background: var(--accent-red);
    color: white;
    transform: scale(1.1) rotate(5deg);
}

/* ============================================
   INFO BOX
============================================ */
.info-box {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.info-box i {
    color: var(--accent-blue);
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-box strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.info-box p {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
}

/* ============================================
   CARDS
============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 24px;
    transition: all 0.3s;
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

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

.card h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
}

.card h2 i {
    color: var(--accent-purple);
    font-size: 0.9em;
}

.card-badge {
    background: linear-gradient(135deg, var(--accent-pink) 0%, #DB2777 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

.card-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ============================================
   GRID
============================================ */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.full {
    grid-column: 1 / 3;
}

/* ============================================
   CAMPOS
============================================ */
.campo {
    display: flex;
    flex-direction: column;
}

.campo label {
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.campo label i {
    color: var(--accent-purple);
    font-size: 12px;
}

.campo small {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.campo input,
.campo textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    outline: none;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.campo textarea {
    resize: vertical;
    min-height: 100px;
}

.campo input:focus,
.campo textarea:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.campo input::placeholder,
.campo textarea::placeholder {
    color: var(--text-muted);
}

/* ============================================
   UPLOAD
============================================ */
.upload-box {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.upload-preview {
    position: relative;
    background: var(--bg-input);
    border: 2px dashed var(--border);
    border-radius: 10px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.3s;
}

.upload-preview:hover {
    border-color: var(--accent-purple);
}

.upload-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.upload-controls small {
    color: var(--text-muted);
    font-size: 12px;
}

.preview-logo {
    width: 220px;
    max-width: 100%;
    border-radius: 8px;
    background: white;
    padding: 15px;
}

.preview-banner {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 10px;
    display: none;
}

.preview-banner.ativo {
    display: block;
}

.upload-placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

.upload-placeholder i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
    display: block;
}

.upload-placeholder p {
    font-size: 14px;
}

/* ============================================
   CAROUSEL / SLIDES
============================================ */
.carousel-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.slide-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.3s;
    animation: slideIn 0.3s ease;
}

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

.slide-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.slide-number {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #4F46E5 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.slide-preview {
    position: relative;
    width: 100%;
    height: 200px;
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-slide {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.preview-slide.ativo {
    display: block;
}

.slide-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.slide-placeholder i {
    font-size: 36px;
    margin-bottom: 8px;
    opacity: 0.5;
    display: block;
}

.slide-placeholder p {
    font-size: 13px;
}

.slide-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.slide-fields input[type="text"],
.slide-fields textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    font-size: 13px;
    transition: all 0.2s;
}

.slide-fields input:focus,
.slide-fields textarea:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.slide-fields textarea {
    resize: vertical;
    min-height: 70px;
}

/* ============================================
   TOAST NOTIFICATION
============================================ */
.toast-notif {
    position: fixed;
    top: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 9999;
    max-width: 400px;
}

.toast-notif.show {
    transform: translateX(0);
}

.toast-success {
    border-color: var(--accent-green);
}

.toast-success i {
    color: var(--accent-green);
}

.toast-error {
    border-color: var(--accent-red);
}

.toast-error i {
    color: var(--accent-red);
}

.toast-info {
    border-color: var(--accent-blue);
}

.toast-info i {
    color: var(--accent-blue);
}

.toast-notif i {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-notif span {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   SCROLL
============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ============================================
   RESPONSIVO
============================================ */
@media (max-width: 900px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    .full {
        grid-column: auto;
    }
}

@media (max-width: 768px) {
    .admin-container {
        padding: 16px;
    }
    
    .admin-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-left {
        justify-content: space-between;
    }
    
    .header-actions {
        width: 100%;
    }
    
    .header-actions .btn-primary,
    .header-actions .btn-secondary {
        flex: 1;
        justify-content: center;
    }
    
    .card {
        padding: 20px;
    }
    
    .carousel-container {
        grid-template-columns: 1fr;
    }
    
    .preview-slide {
        height: 180px;
    }
    
    .preview-banner {
        max-height: 220px;
    }
    
    .toast-notif {
        left: 16px;
        right: 16px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .admin-header h1 {
        font-size: 22px;
    }
    
    .card h2 {
        font-size: 18px;
    }
    
    .campo input,
    .campo textarea {
        font-size: 14px;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-upload {
        font-size: 13px;
        padding: 10px 16px;
    }
    
    .preview-logo {
        width: 160px;
    }
}