/* ================================================
   IMGCARROSSEL - CSS
   Paleta Instagram (sem degradês)
   ================================================ */

:root {
    /* Instagram Colors */
    --primary: #E4405F;
    --secondary: #833AB4;
    --accent: #FD1D1D;
    --bg-main: #FAFAFA;
    --bg-white: #FFFFFF;
    --text-dark: #262626;
    --text-light: #8E8E8E;
    --border: #DBDBDB;
    --success: #00C851;
    --warning: #FFB800;
    --error: #FF4444;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================================
   RESET & BASE
   ================================================ */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* ================================================
   TYPOGRAPHY
   ================================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    opacity: 0.8;
}

/* ================================================
   CONTAINER & LAYOUT
   ================================================ */

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

.container-sm {
    max-width: 600px;
}

.container-md {
    max-width: 900px;
}

/* ================================================
   HEADER & NAVIGATION
   ================================================ */

.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* ================================================
   BUTTONS
   ================================================ */

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: #d93651;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #6f2d99;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-dark);
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #cc0000;
}

/* ================================================
   FORMS
   ================================================ */

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.875rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-white);
    transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(228, 64, 95, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

.form-error {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--error);
}

/* ================================================
   CARDS
   ================================================ */

.card {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

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

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-main);
}

/* ================================================
   GRID
   ================================================ */

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* ================================================
   ALERTS
   ================================================ */

.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ================================================
   BADGES
   ================================================ */

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-draft {
    background: #ffeaa7;
    color: #856404;
}

.badge-completed {
    background: #d1f2eb;
    color: #0c5460;
}

.badge-published {
    background: #d4edda;
    color: #155724;
}

/* ================================================
   STATS
   ================================================ */

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

.stat-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-change {
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--error);
}

/* ================================================
   LOGIN PAGE
   ================================================ */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-box {
    background: var(--bg-white);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo-icon {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.login-title {
    text-align: center;
    margin-bottom: 2rem;
}

/* ================================================
   CAROUSEL PREVIEW
   ================================================ */

.carousel-preview {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem;
    scroll-snap-type: x mandatory;
}

.slide-preview {
    flex: 0 0 300px;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    scroll-snap-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.slide-preview:hover {
    transform: scale(1.05);
}

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

/* ================================================
   UTILITIES
   ================================================ */

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-muted { color: var(--text-light); }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.py-4 { padding-top: 2rem; padding-bottom: 2rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }

/* ================================================
   ERROR PAGE
   ================================================ */

.error-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.error-page h1 {
    font-size: 5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.error-detail {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .login-box {
        padding: 2rem;
    }
}

/* ================================================
   BRANDING SYSTEM STYLES
   ================================================ */

/* Color Picker */
.color-picker-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.color-picker-wrapper input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
}

.color-picker-wrapper .color-hex {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: monospace;
    text-transform: uppercase;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

/* Brand Images */
.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-number {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.brand-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.brand-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border);
    cursor: pointer;
}

.brand-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.brand-image-item:hover img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s;
    color: white;
}

.brand-image-item:hover .image-overlay {
    transform: translateY(0);
}

.image-overlay p {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
}

.image-type {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

/* Palettes */
.palettes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.palette-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    background: white;
}

.palette-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.palette-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.palette-colors {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.color-swatch {
    flex: 1;
    height: 50px;
    border-radius: 4px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.2s;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch-sm {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid var(--border);
    display: inline-block;
}

.palette-colors-inline {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.palette-stats {
    margin: 0.5rem 0;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Brand Stats */
.brand-stats {
    display: flex;
    gap: 1.5rem;
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.stat {
    text-align: center;
}

.stat strong {
    display: block;
    font-size: 1.5rem;
    color: var(--primary);
}

.stat span {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Brand Logo */
.brand-logo {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    border-radius: 8px 8px 0 0;
    padding: 1rem;
}

.brand-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.brand-logo-display {
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}

.brand-logo-display img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.current-logo {
    width: 150px;
    margin-bottom: 1rem;
}

.current-logo img {
    width: 100%;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* Brand Style Tags */
.brand-style {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.style-tag {
    background: var(--bg-main);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    color: var(--text-dark);
    border: 1px solid var(--border);
}

/* Form Sections */
.form-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.form-section h2 {
    margin-top: 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Add Form (inline forms) */
.add-form {
    background: var(--bg-main);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px dashed var(--border);
}

.add-form h3 {
    margin-top: 0;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.brand-section {
    margin: 2rem 0;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.setting-item {
    padding: 1rem;
    background: var(--bg-main);
    border-radius: 4px;
}

.setting-item strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

.setting-item span {
    color: var(--text-light);
}

/* Template Cards */
.template-card {
    display: flex;
    flex-direction: column;
}

.template-preview {
    width: 100%;
    height: 180px;
    background: var(--bg-main);
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.template-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.template-badges {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.template-info {
    margin: 0.5rem 0;
}

.info-item {
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

.template-stats {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
}

.template-features {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.5rem 0;
}

.feature-tag {
    background: var(--secondary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Detail Sections */
.template-details,
.brand-info-section {
    margin: 2rem 0;
}

.detail-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.stats-row {
    display: flex;
    gap: 2rem;
}

.stat-box {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-main);
    border-radius: 8px;
    flex: 1;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Page Header Variations */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    margin: 0;
}

.page-header > div {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Lead Text */
.lead {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Badge Corner */
.badge-corner {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

/* Responsive updates */
@media (max-width: 768px) {
    .color-grid {
        grid-template-columns: 1fr;
    }

    .brand-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .stats-row {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}
