/* ==========================================================================
   CONSULTA DIÁRIO OFICIAL - Layout Minimalista Sem Scroll
   ========================================================================== */

/* Imports */
@import url('base-design-system.css');
@import url('navbar.css');

/* Espaçamento para navbar fixo */
main {
  padding-top: var(--space-8);
}

/* ==========================================================================
   RESET E CONFIGURAÇÕES GLOBAIS - ALTURA FIXA
   ========================================================================== */

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

html, body {
    height: 100vh;
    overflow: hidden; /* Remove scroll global */
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, #f5faff 0%, #ffffff 50%, #f0f9ff 100%);
    background-size: 300% 300%;
    animation: gradient-shift 20s ease infinite;
    color: var(--gray-900);
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(111, 12, 99, 0.03) 0%, transparent 50%), radial-gradient(circle at 80% 20%, rgba(30, 58, 138, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.App {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    flex-shrink: 0; /* Header não encolhe */
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.container {
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   ELEMENTOS DECORATIVOS E EFEITOS
   ========================================================================== */

.floating-shape {
    position: absolute;
    background: linear-gradient(135deg, rgba(111, 12, 99, 0.15), rgba(30, 58, 138, 0.15));
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(1px);
}

.floating-shape:nth-child(1) {
    width: 120px;
    height: 120px;
    top: 5%;
    left: 3%;
    animation: float 8s ease-in-out infinite, pulse 4s ease-in-out infinite;
}

.floating-shape:nth-child(2) {
    width: 80px;
    height: 80px;
    top: 40%;
    right: 8%;
    animation: float 12s ease-in-out infinite reverse, pulse 6s ease-in-out infinite;
}

.floating-shape:nth-child(3) {
    width: 100px;
    height: 100px;
    bottom: 15%;
    left: 15%;
    animation: float 10s ease-in-out infinite, pulse 5s ease-in-out infinite reverse;
}

/* Partículas menores */
.floating-shape::before,
.floating-shape::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(111, 12, 99, 0.2);
    border-radius: 50%;
    animation: particle-float 15s linear infinite;
}

.floating-shape::before {
    top: -30px;
    left: 50%;
    animation-delay: -2s;
}

.floating-shape::after {
    bottom: -30px;
    right: 30%;
    animation-delay: -8s;
}

/* ==========================================================================
   LAYOUT PRINCIPAL COMPACTO
   ========================================================================== */

.diario-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    padding: var(--space-1) 0;
}

.diario-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

/* ==========================================================================
   HEADER MINIMALISTA
   ========================================================================== */

.page-title-section {
    text-align: center;
    margin-bottom: var(--space-2);
    flex-shrink: 0;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
    background: var(--primary-gradient);
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    position: relative;
}

.page-title i {
    color: var(--primary-purple);
    font-size: 1.4rem;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    animation: expand-line 2s ease-out 1s forwards;
}

.page-subtitle {
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 300;
}

/* ==========================================================================
   SISTEMA DE ABAS
   ========================================================================== */

.tab-navigation {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: var(--space-2);
    background: var(--gray-50);
    padding: 4px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.tab-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.9));
    color: var(--primary-purple);
    box-shadow: 0 4px 15px rgba(111, 12, 99, 0.1);
    transform: translateY(-1px) scale(1.05);
}

.tab-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(111, 12, 99, 0.3);
    transform: scale(1.05);
    animation: glow 3s ease-in-out infinite;
}

.tab-btn.active:hover {
    animation: shimmer 1.5s ease-in-out infinite, glow 3s ease-in-out infinite;
}

/* ==========================================================================
   CONTEÚDO DAS ABAS
   ========================================================================== */

.tab-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.tab-panel {
    display: none;
    flex-direction: column;
    height: 100%;
    animation: slide-in 0.6s ease-out;
}

.tab-panel.active {
    display: flex;
}

/* ==========================================================================
   ABA DE BUSCA
   ========================================================================== */

.search-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    margin-bottom: var(--space-3);
    position: relative;
    overflow: hidden;
}

.search-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(111, 12, 99, 0.1), transparent);
    transition: left 0.6s ease;
}

.search-card:hover::before {
    left: 100%;
}

.input-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    position: relative;
}

.input-icon {
    position: absolute;
    left: var(--space-3);
    color: var(--gray-400);
    font-size: 1.1rem;
    z-index: 2;
}

.search-input {
    flex: 1;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-3) var(--space-3) 2.5rem;
    font-size: 0.9rem;
    color: var(--gray-900);
    background: var(--gray-50);
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(111, 12, 99, 0.1), 0 4px 20px rgba(111, 12, 99, 0.1);
    background: white;
    transform: scale(1.02);
}

.search-btn {
    background: var(--primary-gradient), linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.5) 50%, transparent 70%);
    background-size: 100% 100%, 200% 100%;
    color: white;
    border: none;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    transition: all 0.3s ease;
    font-size: 0.85rem;
    position: relative;
    overflow: hidden;
}

.search-btn:hover {
    animation: shimmer 1.5s ease-in-out infinite;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(111, 12, 99, 0.3);
}

.popular-organs {
    margin-top: var(--space-4);
}

.popular-label {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-bottom: var(--space-2);
}

.organs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
}

.organ-btn {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: var(--space-3);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
}

.organ-btn:hover {
    background: linear-gradient(135deg, rgba(111, 12, 99, 0.05), rgba(30, 58, 138, 0.05));
    border-color: var(--primary-purple);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(111, 12, 99, 0.1);
}

.organ-btn i {
    font-size: 1.2rem;
    color: var(--primary-purple);
}

/* ==========================================================================
   ABA DE FILTROS
   ========================================================================== */

.filters-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.filter-group.full-width {
    grid-column: 1 / -1;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-700);
}

.date-range {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.date-separator {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.form-input,
.form-select {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    padding: var(--space-2);
    font-size: 0.85rem;
    color: var(--gray-900);
    background: var(--gray-50);
    outline: none;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(111, 12, 99, 0.1);
    background: white;
}

.filter-actions {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: auto;
}

/* ==========================================================================
   ABA DE RESULTADOS
   ========================================================================== */

.results-section {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.results-header {
    padding: var(--space-3);
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    flex-shrink: 0;
}

.results-count {
    font-size: 0.85rem;
    color: var(--gray-600);
    font-weight: 600;
}

.publications-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-3);
}

/* ==========================================================================
   ABA DE ALERTAS
   ========================================================================== */

.alerts-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.alerts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.alert-option {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: var(--space-3);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.alert-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(111, 12, 99, 0.1), transparent);
    transition: left 0.6s ease;
}

.alert-option:hover::before {
    left: 100%;
}

.alert-option:hover {
    background: linear-gradient(135deg, rgba(111, 12, 99, 0.05), rgba(30, 58, 138, 0.05));
    border-color: var(--primary-purple);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(111, 12, 99, 0.1);
}

.alert-icon {
    margin-bottom: var(--space-2);
}

.alert-icon i {
    font-size: 1.5rem;
    color: var(--primary-purple);
    text-shadow: 0 0 10px rgba(111, 12, 99, 0.3);
}

.alert-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-1);
}

.alert-description {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-bottom: var(--space-2);
    line-height: 1.3;
}

.alert-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.alert-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(111, 12, 99, 0.3);
}

.alerts-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-3);
}

.empty-alerts {
    text-align: center;
    color: var(--gray-500);
    font-size: 0.85rem;
}

.empty-alerts i {
    font-size: 2rem;
    margin-bottom: var(--space-2);
    opacity: 0.5;
}

/* ==========================================================================
   ESTADOS VAZIOS
   ========================================================================== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8) var(--space-4);
    text-align: center;
    color: var(--gray-500);
}

.empty-icon {
    margin-bottom: var(--space-4);
}

.empty-icon i {
    font-size: 3rem;
    opacity: 0.5;
}

.empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
}

.empty-description {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ==========================================================================
   BOTÕES
   ========================================================================== */

.btn-primary,
.btn-secondary {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-1);
    transition: all 0.3s ease;
    border: none;
    font-size: 0.8rem;
}

.btn-primary {
    background: var(--primary-gradient), linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.5) 50%, transparent 70%);
    background-size: 100% 100%, 200% 100%;
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    animation: shimmer 1.5s ease-in-out infinite;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(111, 12, 99, 0.3);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-200);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg) scale(1); 
        opacity: 0.6;
    }
    25% { 
        transform: translateY(-15px) rotate(90deg) scale(1.1); 
        opacity: 0.8;
    }
    50% { 
        transform: translateY(-30px) rotate(180deg) scale(0.9); 
        opacity: 1;
    }
    75% { 
        transform: translateY(-15px) rotate(270deg) scale(1.1); 
        opacity: 0.8;
    }
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(111, 12, 99, 0.7);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 0 20px rgba(111, 12, 99, 0);
        transform: scale(1.05);
    }
}

@keyframes particle-float {
    0% { 
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { 
        transform: translateY(-100vh) translateX(50px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes glow {
    0%, 100% { 
        box-shadow: 0 0 5px rgba(111, 12, 99, 0.5), 0 0 10px rgba(111, 12, 99, 0.3), 0 0 15px rgba(111, 12, 99, 0.1);
    }
    50% { 
        box-shadow: 0 0 10px rgba(111, 12, 99, 0.8), 0 0 20px rgba(111, 12, 99, 0.6), 0 0 30px rgba(111, 12, 99, 0.4);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
}

@keyframes slide-in {
    0% { 
        opacity: 0;
        transform: translateY(20px);
    }
    100% { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes expand-line {
    to { width: 60px; }
}

/* ==========================================================================
   RETÂNGULOS DECORATIVOS DE FUNDO
   ========================================================================== */

.background-rectangles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    overflow: hidden;
}

.bg-rect {
    position: absolute;
    background: linear-gradient(135deg, rgba(111, 12, 99, 0.05), rgba(30, 58, 138, 0.08));
    border-radius: 12px;
    filter: blur(0.5px);
    animation: float-rect 20s ease-in-out infinite;
}

.rect-1 {
    width: 200px;
    height: 120px;
    top: 10%;
    left: -50px;
    transform: rotate(-15deg);
    animation-delay: 0s;
    animation-duration: 25s;
}

.rect-2 {
    width: 150px;
    height: 80px;
    top: 30%;
    right: -30px;
    transform: rotate(20deg);
    animation-delay: -5s;
    animation-duration: 30s;
}

.rect-3 {
    width: 180px;
    height: 100px;
    bottom: 20%;
    left: 5%;
    transform: rotate(10deg);
    animation-delay: -10s;
    animation-duration: 35s;
}

.rect-4 {
    width: 120px;
    height: 200px;
    top: 50%;
    right: 10%;
    transform: rotate(-25deg);
    animation-delay: -15s;
    animation-duration: 28s;
}

.rect-5 {
    width: 160px;
    height: 90px;
    bottom: 40%;
    right: -40px;
    transform: rotate(35deg);
    animation-delay: -8s;
    animation-duration: 32s;
}

.rect-6 {
    width: 140px;
    height: 110px;
    top: 70%;
    left: -20px;
    transform: rotate(-30deg);
    animation-delay: -12s;
    animation-duration: 26s;
}

@keyframes float-rect {
    0%, 100% {
        transform: translateY(0px) translateX(0px) rotate(var(--initial-rotation, 0deg));
        opacity: 0.3;
    }
    25% {
        transform: translateY(-30px) translateX(20px) rotate(calc(var(--initial-rotation, 0deg) + 5deg));
        opacity: 0.6;
    }
    50% {
        transform: translateY(-60px) translateX(-15px) rotate(calc(var(--initial-rotation, 0deg) + 10deg));
        opacity: 0.8;
    }
    75% {
        transform: translateY(-30px) translateX(25px) rotate(calc(var(--initial-rotation, 0deg) + 5deg));
        opacity: 0.6;
    }
}

/* Variações de rotação inicial */
.rect-1 { --initial-rotation: -15deg; }
.rect-2 { --initial-rotation: 20deg; }
.rect-3 { --initial-rotation: 10deg; }
.rect-4 { --initial-rotation: -25deg; }
.rect-5 { --initial-rotation: 35deg; }
.rect-6 { --initial-rotation: -30deg; }

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

@media (max-width: 768px) {
    .organs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .alerts-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .date-range {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .tab-btn span {
        display: none;
    }
    
    .organs-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-1);
    }
    
    .organ-btn {
        padding: var(--space-2);
    }
}