/* ============================================
   SKIN COMPARTILHADO - EDGAR
   Arquivo centralizado para cores e estilos
   Usado por: index.php, login.php, pacientes.php, prontuario.php, seglistado.php
   ============================================ */

/* ============================================
   CORES PRINCIPAIS
   ============================================ */
:root {
    --primary-gradient-start: #667eea;
    --primary-gradient-end: #764ba2;
    --primary-color: #667eea;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --text-dark: #333333;
    --text-gray: #666666;
    --text-muted: #999999;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(102, 126, 234, 0.1);
    --focus-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* ============================================
   CORPO E BACKGROUND
   ============================================ */
body {
    background-color: var(--bg-light);
    padding: 20px 0;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

.nav-user {
    color: rgba(255, 255, 255, 0.8);
    margin-right: 15px;
    font-size: 0.9rem;
}

/* ============================================
   CONTAINERS PRINCIPAIS
   ============================================ */
.container-main {
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    padding: 30px;
    margin-bottom: 30px;
    overflow: hidden;
}

.prontuario-container {
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* ============================================
   HEADERS/PAGE HEADERS
   ============================================ */
.header {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    color: white;
    padding: 30px;
    margin: -30px -30px 30px -30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.header h1 {
    color: white;
    font-weight: 600;
    font-size: 1.8rem;
    margin: 0;
}

.prontuario-header {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    color: white;
    padding: 30px;
    margin-bottom: 30px;
}

.prontuario-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: bold;
}

.page-header {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    color: white;
    padding: 30px;
    margin: -30px -30px 30px -30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    font-size: 2rem;
    margin: 0;
    font-weight: bold;
}

.page-header p {
    margin: 5px 0 0 0;
    opacity: 0.9;
}

/* ============================================
   HEADER ACTIONS
   ============================================ */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ============================================
   INFORMAÇÕES DO PACIENTE
   ============================================ */
.paciente-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.info-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid white;
}

.info-label {
    font-size: 0.85rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 600;
}

/* ============================================
   SUMMARY CARD (seglistado)
   ============================================ */
.info-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.summary-card {
    background: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    border-left: 4px solid var(--primary-color);
}

.summary-card h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0;
}

.summary-card p {
    color: var(--text-gray);
    font-size: 0.85rem;
    margin: 5px 0 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   ABAS/TABS
   ============================================ */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 25px;
}

.nav-link {
    color: var(--text-gray);
    border: none;
    font-weight: 500;
    position: relative;
    padding: 12px 20px;
    transition: all 0.3s ease;
    margin-right: 5px;
    border-radius: 6px 6px 0 0;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-bottom: 3px solid var(--primary-color);
}

.nav-link .badge,
.badge-count {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    margin-left: 8px;
}

/* Cores das abas */
#tumor-tab {
    background-color: #fff3e0;
}

#tumor-tab.active {
    background-color: #ffe8cc;
}

#cirurgia-tab {
    background-color: #e8f5e9;
}

#cirurgia-tab.active {
    background-color: #d4edda;
}

#estadiamento-tab {
    background-color: #f3e5f5;
}

#estadiamento-tab.active {
    background-color: #e1bee7;
}

#tratamento-tab {
    background-color: #ffe8e8;
}

#tratamento-tab.active {
    background-color: #ffd4d4;
}

#seguimento-tab {
    background-color: #e3f2fd;
}

#seguimento-tab.active {
    background-color: #cce5ff;
}

/* ============================================
   TAB CONTENT
   ============================================ */
.tab-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   CARDS
   ============================================ */
.card-item {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    background: #f9f9f9;
    animation: fadeIn 0.3s ease;
}

.card-item:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-header-prontuario {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-header-seglistado {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.card-title-section {
    flex: 1;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.card-subtitle {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.card-title-seglistado {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 10px 0;
}

.card-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-white);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.card-date-seglistado {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-white);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    white-space: nowrap;
    margin-left: 10px;
}

.card-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 12px;
}

/* ============================================
   CAMPOS/FIELDS
   ============================================ */
.field-group {
    padding: 10px 0;
}

.field-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.field-value {
    font-size: 0.95rem;
    color: var(--text-dark);
    font-weight: 500;
}

/* ============================================
   BOTÕES
   ============================================ */
.btn-voltar {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    transition: all 0.3s ease;
}

.btn-voltar:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.btn-custom {
    border-radius: 5px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-back {
    background: #f0f0f0;
    border: 1px solid #ddd;
    color: var(--text-dark);
    padding: 8px 16px;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: #e0e0e0;
    color: var(--text-dark);
    text-decoration: none;
}

.btn-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.btn-sm {
    font-size: 0.8rem;
    padding: 4px 12px;
}

.btn-action-sm {
    flex: 1;
    min-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   FORMS
   ============================================ */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: var(--focus-shadow);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    color: white;
}

/* ============================================
   ALERTAS
   ============================================ */
.alert-custom {
    border-radius: 8px;
    border-left: 4px solid;
    margin-bottom: 20px;
}

/* ============================================
   ESTADOS VAZIOS
   ============================================ */
.no-data,
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.no-data i,
.empty-state i {
    font-size: 3rem;
    opacity: 0.3;
    display: block;
    margin-bottom: 15px;
}

.empty-state {
    padding: 60px 20px;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 1.1rem;
}

/* ============================================
   LINKS
   ============================================ */
.paciente-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.paciente-link:hover {
    text-decoration: underline;
}

.badge-info {
    display: inline-block;
    background: #f0f0f0;
    color: var(--text-gray);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-right: 8px;
    margin-top: 5px;
}

/* ============================================
   TABELAS
   ============================================ */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table thead {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    color: white;
}

.table tbody tr:hover {
    background-color: var(--bg-light);
}

/* ============================================
   TEXTO
   ============================================ */
.text-muted-custom {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.back-button-container {
    margin-bottom: 20px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .container-main {
        padding: 20px;
    }

    .header,
    .page-header,
    .prontuario-header {
        margin-bottom: 20px;
    }

    .header h1,
    .page-header h1 {
        font-size: 1.5rem;
    }

    .prontuario-header h1 {
        font-size: 1.5rem;
    }

    .table {
        font-size: 0.85rem;
    }

    .table thead th {
        padding: 10px 5px;
    }

    .table tbody td {
        padding: 10px 5px;
    }

    .hide-mobile {
        display: none;
    }

    .btn-actions {
        flex-direction: column;
    }

    .btn-action-sm {
        min-width: auto;
        width: 100%;
    }

    .btn-sm {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    .info-summary {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }

    .summary-card {
        padding: 15px;
    }

    .summary-card h3 {
        font-size: 1.5rem;
    }

    .card-header,
    .card-header-seglistado {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-date,
    .card-date-seglistado {
        margin-left: 0;
        margin-top: 10px;
    }
}

@media (max-width: 576px) {
    .container-main {
        padding: 15px;
    }

    .header,
    .page-header,
    .prontuario-header {
        margin-bottom: 15px;
    }

    .header h1,
    .page-header h1 {
        font-size: 1.3rem;
    }

    .prontuario-header h1 {
        font-size: 1.3rem;
    }

    .header .row {
        flex-direction: column;
    }

    .header .col {
        margin-bottom: 10px;
    }

    .header .col.text-end {
        text-align: left !important;
    }

    .table {
        font-size: 0.75rem;
    }

    .table thead th {
        padding: 8px 3px;
    }

    .table tbody td {
        padding: 8px 3px;
    }

    .btn-action-dropdown {
        position: relative;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .card-row {
        grid-template-columns: 1fr;
    }

    .info-summary {
        grid-template-columns: 1fr;
    }

    .paciente-info {
        grid-template-columns: 1fr;
    }

    .nav-link .badge,
    .badge-count {
        display: block;
        margin-left: 0;
        margin-top: 5px;
    }
}

/* ============================================
   ANIMAÇÕES ADICIONAIS
   ============================================ */
.btn-custom:hover,
.btn-back:hover {
    animation: none;
}

.card-item {
    animation: fadeIn 0.3s ease;
}
