:root {
    --primary-color: #FF6B35;
    --primary-dark: #E85A2C;
    --secondary-color: #1E3A8A;
    --dark-color: #1B2636;
    --gray-color: #6B7280;
    --light-color: #F9FAFB;
    --sidebar-width: 280px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-color);
}

/* Header Principal */
.main-header {
    background-color: var(--dark-color);
    color: white;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 60px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}

.header-logo h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 600;
}

.header-logo i {
    font-size: 1.75rem;
    color: var(--primary-color);
}

.header-nav {
    display: flex;
    gap: 0;
}

.header-nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    height: 60px;
}

.header-nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.header-nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    border-bottom-color: var(--primary-color);
}

.header-nav-link i {
    font-size: 1.1rem;
}

/* Ajuste do conteúdo principal com header */
body.with-header {
    padding-top: 60px;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 60px; /* Ajustado para o header */
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    background-color: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
}

.sidebar-heading {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-color);
}

.sidebar .nav-link {
    color: var(--dark-color);
    padding: 0.75rem 1rem;
    margin: 0.25rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.sidebar .nav-link i {
    font-size: 1rem;
}

/* Main Content */
main {
    margin-left: var(--sidebar-width);
    padding: 2rem;
}

@media (max-width: 767px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }
    
    main {
        margin-left: 0;
    }
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem;
    overflow: hidden;
}

.card-header {
    background-color: white;
    border-bottom: 2px solid var(--light-color);
    padding: 1.25rem;
}

.card-header h5 {
    color: var(--dark-color);
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Form Controls */
.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(255, 107, 53, 0.1);
}

.form-control-color {
    width: 50px;
    height: 38px;
    padding: 0.25rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: var(--gray-color);
    border-color: var(--gray-color);
}

.btn-secondary:hover {
    background-color: #4b5563;
    border-color: #4b5563;
}

/* Image Preview */
.preview-container {
    position: relative;
    display: none;
}

.preview-container img {
    max-width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preview-container.show {
    display: block;
}

/* Progress Bar */
.progress {
    height: 1.5rem;
    border-radius: 0.5rem;
    background-color: #e5e7eb;
}

.progress-bar {
    background-color: var(--primary-color);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: 0.75rem;
}

.modal-header {
    border-bottom: none;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e5e7eb;
    padding: 1.5rem;
}

/* Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

/* Botão de preenchimento automático */
.auto-fill-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
}

.auto-fill-btn {
    border-radius: 50px;
    padding: 12px 20px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: pulse-warning 2s infinite;
    transition: all 0.3s ease;
}

.auto-fill-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    animation: none;
}

@keyframes pulse-warning {
    0% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
    }
    100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Seções da página - Toggles */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-rgb), 0.25);
}

.form-check-label.text-muted {
    opacity: 0.6;
}

.section-toggle-container {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.section-toggle-container:hover {
    background-color: #f9fafb;
    border-color: var(--primary-color);
}

/* Form Validation */
.form-control:invalid:not(:focus) {
    border-color: #ef4444;
}

.form-control:valid:not(:focus) {
    border-color: #10b981;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    main {
        padding: 1rem;
    }
    
    /* Header mobile */
    .header-logo h1 {
        font-size: 1.2rem;
    }
    
    .header-nav-link {
        padding: 1rem;
    }
    
    .header-nav-link span {
        display: none;
    }
    
    .header-nav-link i {
        font-size: 1.3rem;
    }
}

/* Template Images Modal */
.template-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.template-image-item {
    border: 2px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.template-image-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.template-image-item.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.25);
}

.template-image-preview {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.template-image-info {
    padding: 10px;
}

.template-image-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
    color: #212529;
}

.template-image-desc {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
}

.btn-select-template {
    padding: 4px 12px;
    font-size: 12px;
    margin-left: 5px;
}