/* ========================================
   BASE STYLES - Extracted from base.html
   Performance optimization: External CSS enables browser caching
   ======================================== */

/* ========================================
   FONT LOADING OPTIMIZATION
   ======================================== */

/* Fallback font stack enquanto Inter carrega */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif;
}

/* Inter quando carregada */
body.fonts-loaded {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ========================================
   GLOBAL LAYOUT
   ======================================== */

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #fce7f3 0%, #f3e8ff 50%, #e0e7ff 100%);
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(236, 72, 153, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ========================================
   NAVBAR STYLES
   ======================================== */

.navbar {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #6366f1 100%) !important;
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.2);
    padding: 0.5rem 0;
    position: relative;
    z-index: 10;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
    transition: transform 0.3s;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand img {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    background: white;
    padding: 6px;
    border-radius: 10px;
    transition: all 0.3s;
}

.navbar-brand:hover img {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

.dropdown-menu {
    border: none;
    box-shadow: 0 8px 30px rgba(236, 72, 153, 0.15);
    border-radius: 12px;
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, #fce7f3 0%, #f3e8ff 100%);
    transform: translateX(5px);
}

.dropdown-item i {
    margin-right: 8px;
    width: 20px;
    color: #ec4899;
}

/* ========================================
   MAIN CONTAINER
   ======================================== */

.main-container {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative;
    z-index: 1;
}

/* Responsive container */
@media (max-width: 576px) {
    .main-container {
        padding: 1rem 0.5rem;
    }
}

/* ========================================
   ALERTS
   ======================================== */

.alert {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert i {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-danger, .alert-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* ========================================
   FOOTER
   ======================================== */

footer {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(236, 72, 153, 0.1);
    padding: 1.5rem 0;
    margin-top: 3rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    position: relative;
    z-index: 10;
}

footer a {
    color: #ec4899;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

footer a:hover {
    color: #8b5cf6;
    text-decoration: underline;
}

/* ========================================
   GLOBAL RESPONSIVE DESIGN SYSTEM
   ======================================== */

/* Cards responsivos */
.card {
    border-radius: 16px;
    overflow: hidden;
}

@media (max-width: 768px) {
    .card {
        border-radius: 12px;
    }

    .card-body {
        padding: 1.25rem;
    }
}

/* Botões touch-friendly */
.btn {
    min-height: 44px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .btn {
        min-height: 48px;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn-group .btn {
        width: auto;
        margin-bottom: 0;
    }
}

/* Formulários responsivos */
.form-control, .form-select {
    min-height: 44px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #ec4899;
    box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.1);
}

@media (max-width: 768px) {
    .form-control, .form-select, textarea.form-control {
        font-size: 16px; /* Previne zoom no iOS */
        min-height: 48px;
    }
}

/* Imagens responsivas */
img {
    max-width: 100%;
    height: auto;
}

.img-thumbnail {
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    padding: 4px;
}

/* Tabelas responsivas */
.table-responsive {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    .table {
        font-size: 0.875rem;
    }

    .table td, .table th {
        padding: 0.5rem;
    }
}

/* Grid system melhorado */
.row {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.row > * {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

@media (max-width: 768px) {
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    .row > * {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Stack columns em mobile */
    .row > [class*='col-'] {
        margin-bottom: 1rem;
    }
}

/* ========================================
   MODALS
   ======================================== */

/* Modais - Estilos simples (deixar Bootstrap gerenciar comportamento) */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-footer form {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    justify-content: flex-end;
}

/* Ícones dentro de botões não devem capturar cliques */
button i,
.btn i {
    pointer-events: none;
}

@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-content {
        border-radius: 12px;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .modal-header {
        padding: 1rem 1.25rem;
    }

    .modal-footer {
        padding: 1rem 1.25rem;
        flex-direction: column;
    }

    .modal-footer form {
        flex-direction: column;
        width: 100%;
    }

    .modal-footer .btn,
    .modal-footer form .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .modal-footer .btn:last-child,
    .modal-footer form .btn:last-child {
        margin-bottom: 0;
    }
}

/* ========================================
   BADGES AND PILLS
   ======================================== */

.badge {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
}

/* ========================================
   TABS RESPONSIVAS
   ======================================== */

.nav-tabs {
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.nav-tabs::-webkit-scrollbar {
    height: 4px;
}

.nav-tabs .nav-link {
    border-radius: 8px 8px 0 0;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* ========================================
   TYPOGRAPHY RESPONSIVA
   ======================================== */

h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
h5 { font-size: clamp(1rem, 2vw, 1.25rem); }

/* ========================================
   NAVBAR SPECIFIC STYLES
   ======================================== */

.navbar {
    padding: 1rem 0;
}

.navbar-toggler {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
}

.navbar-collapse {
    background: transparent;
}

@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(10px);
        border-radius: 12px;
        margin-top: 1rem;
        padding: 1rem;
    }

    .navbar-nav {
        gap: 0.5rem;
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        text-align: center;
        padding: 0.75rem 1rem !important;
    }

    .dropdown-menu {
        width: 100%;
        text-align: center;
    }
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
    .main-container {
        padding: 1rem 0.75rem;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .navbar-brand img {
        height: 32px;
        padding: 6px;
    }

    .navbar-brand span {
        display: none;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 0.9375rem;
    }

    .navbar-brand img {
        height: 28px;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   TOUCH OPTIMIZATIONS
   ======================================== */

@media (hover: none) and (pointer: coarse) {
    /* Touch device optimizations */
    a, button, .btn, [role="button"] {
        -webkit-tap-highlight-color: rgba(236, 72, 153, 0.2);
    }

    .dropdown-item {
        padding: 1rem 1.25rem;
    }
}

/* ========================================
   LANDSCAPE MOBILE
   ======================================== */

@media (max-width: 896px) and (orientation: landscape) {
    .navbar {
        padding: 0.5rem 0;
    }

    .main-container {
        padding: 1rem;
    }
}
