/* ===== RESPONSIVE DESIGN & MODERN STYLES ===== */

/* Variáveis CSS adicionais para responsividade */
:root {
    --mobile-breakpoint: 768px;
    --tablet-breakpoint: 1024px;
    --desktop-breakpoint: 1200px;
    --container-padding: 1rem;
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===== LAYOUT RESPONSIVO ===== */

/* Container responsivo */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--container-padding);
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.col {
    flex: 1;
    padding: 0 0.5rem;
}

.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* ===== COMPONENTES MODERNOS ===== */

/* Cards modernos */
.modern-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    transition: var(--transition-normal);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.modern-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.modern-card .card-header {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.modern-card .card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.modern-card .card-subtitle {
    font-size: 0.9rem;
    color: #666;
    margin: 0.25rem 0 0 0;
}

/* Botões modernos */
.btn-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-md);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition-normal);
}

.btn-modern:hover::before {
    left: 100%;
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-gradient:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Inputs modernos */
.input-modern {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    transition: var(--transition-fast);
    background: white;
}

.input-modern:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group label {
    position: absolute;
    top: 0.875rem;
    left: 1rem;
    color: #666;
    transition: var(--transition-fast);
    pointer-events: none;
    background: white;
    padding: 0 0.25rem;
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    top: -0.5rem;
    font-size: 0.875rem;
    color: var(--primary-color);
}

/* Badges modernos */
.badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: #333;
}

.badge-danger {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
    color: white;
}

.badge-info {
    background: linear-gradient(135deg, #17a2b8, #6f42c1);
    color: white;
}

/* Tabelas modernas */
.table-modern {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-modern th {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.table-modern td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    transition: var(--transition-fast);
}

.table-modern tbody tr:hover {
    background: #f8f9fa;
}

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

/* Modais modernos */
.modal-modern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.modal-modern.active {
    opacity: 1;
    visibility: visible;
}

.modal-modern .modal-content {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition-normal);
}

.modal-modern.active .modal-content {
    transform: scale(1);
}

/* Navegação moderna */
.nav-modern {
    background: white;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-modern .nav-item {
    position: relative;
}

.nav-modern .nav-link {
    padding: 1rem 1.5rem;
    color: #666;
    text-decoration: none;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.nav-modern .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary-color);
    transition: var(--transition-normal);
}

.nav-modern .nav-link:hover::before,
.nav-modern .nav-link.active::before {
    width: 100%;
}

.nav-modern .nav-link:hover,
.nav-modern .nav-link.active {
    color: var(--primary-color);
}

/* ===== RESPONSIVIDADE ===== */

/* Tablet */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .col-md-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-md-9 { flex: 0 0 75%; max-width: 75%; }
    .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
    
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --container-padding: 1rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .row {
        margin: 0 -0.25rem;
    }
    
    .col {
        padding: 0 0.25rem;
    }
    
    .col-sm-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-sm-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
    .col-sm-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-sm-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
    .col-sm-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-sm-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-sm-9 { flex: 0 0 75%; max-width: 75%; }
    .col-sm-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-sm-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
    
    /* Dashboard mobile */
    .dashboard-container {
        padding: 1rem;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }
    
    /* Navegação mobile */
    .nav-modern {
        position: relative;
    }
    
    .nav-modern .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        box-shadow: var(--shadow-md);
        flex-direction: column;
    }
    
    .nav-modern .nav-menu.active {
        display: flex;
    }
    
    .nav-modern .nav-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        padding: 1rem;
        cursor: pointer;
    }
    
    /* Formulários mobile */
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-modern {
        width: 100%;
        justify-content: center;
    }
    
    /* Tabelas mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-modern {
        min-width: 600px;
    }
    
    /* Modais mobile */
    .modal-modern .modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 2rem);
    }
    
    /* Cards mobile */
    .modern-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Upload de documentos mobile */
    .document-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .document-card {
        padding: 1rem;
    }
    
    .upload-container {
        margin: 1rem;
        padding: 1rem;
    }
}

/* Mobile pequeno */
@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .modern-card {
        padding: 0.75rem;
    }
    
    .btn-modern {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }
    
    .input-modern {
        padding: 0.75rem;
    }
    
    .table-modern th,
    .table-modern td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .stat-card h3 {
        font-size: 1.25rem;
    }
    
    .stat-card p {
        font-size: 0.8rem;
    }
}

/* ===== UTILITÁRIOS RESPONSIVOS ===== */

/* Visibilidade */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

@media (max-width: 768px) {
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
    .d-sm-flex { display: flex !important; }
}

@media (min-width: 769px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
}

/* Texto */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

@media (max-width: 768px) {
    .text-sm-center { text-align: center !important; }
    .text-sm-left { text-align: left !important; }
}

/* Margens e padding */
.m-0 { margin: 0 !important; }
.m-1 { margin: 0.25rem !important; }
.m-2 { margin: 0.5rem !important; }
.m-3 { margin: 1rem !important; }
.m-4 { margin: 1.5rem !important; }
.m-5 { margin: 3rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

/* Flexbox */
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }

/* ===== ANIMAÇÕES MODERNAS ===== */

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.6s ease-out;
}

.animate-fadeInRight {
    animation: fadeInRight 0.6s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-bounce {
    animation: bounce 1s infinite;
}

/* ===== DARK MODE SUPPORT ===== */

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #e0e0e0;
        --card-bg: #2d2d2d;
        --border-color: #404040;
    }
    
    .dark-mode-support {
        background-color: var(--bg-color);
        color: var(--text-color);
    }
    
    .dark-mode-support .modern-card {
        background: var(--card-bg);
        border-color: var(--border-color);
    }
    
    .dark-mode-support .input-modern {
        background: var(--card-bg);
        border-color: var(--border-color);
        color: var(--text-color);
    }
    
    .dark-mode-support .table-modern {
        background: var(--card-bg);
        color: var(--text-color);
    }
    
    .dark-mode-support .table-modern th {
        background: var(--border-color);
    }
}

/* ===== PRINT STYLES ===== */

@media print {
    .no-print {
        display: none !important;
    }
    
    .modern-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn-modern {
        display: none;
    }
    
    .table-modern {
        box-shadow: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    .modern-card {
        page-break-inside: avoid;
    }
}