@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #4f46e5;       /* Indigo */
    --secondary: #9333ea;     /* Purple */
    --accent: #f43f5e;        /* Rose */
    --bg-base: #0f172a;       /* Slate 900 - Dark mode base */
    --bg-surface: #1e293b;    /* Slate 800 */
    --bg-glass: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;  /* Slate 50 */
    --text-secondary: #94a3b8;/* Slate 400 */
    --border-color: rgba(255, 255, 255, 0.1);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 9999px;
    
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-glow: 0 0 20px rgba(147, 51, 234, 0.3);
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(79, 70, 229, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(147, 51, 234, 0.15) 0%, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 60px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

header h1, header .site-title {
    font-size: 3.5em;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

.site-title a {
    text-decoration: none;
}

header p {
    font-size: 1.2em;
    font-weight: 400;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    flex: 1;
    width: 100%;
}

/* Glassmorphism Containers */
.posts-container, .post-content {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-glass);
    transition: var(--transition-normal);
    display: flow-root;
}

.posts-container:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-glass), var(--shadow-glow);
}

main h2 {
    font-size: 2.2em;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

main h2::before {
    content: '';
    display: block;
    width: 32px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: var(--radius-pill);
}

.posts-container h3 {
    font-size: 1.8em;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 40px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
}

.posts-container h2 + h3 {
    margin-top: 20px;
}

.posts-container h3::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    border-radius: 3px;
    transform: rotate(45deg);
    box-shadow: 0 0 10px rgba(147, 51, 234, 0.5);
}

/* Modern Lists as Grid Cards */
.posts-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.posts-list li {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
}

.posts-list a {
    display: flex;
    align-items: center;
    padding: 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1em;
}

.posts-list a::before {
    content: '✦';
    color: var(--secondary);
    margin-right: 12px;
    font-size: 1.2em;
    transition: var(--transition-normal);
}

.posts-list li:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    border-color: var(--secondary);
    box-shadow: var(--shadow-glow);
}

.posts-list li:hover a::before {
    transform: rotate(90deg) scale(1.2);
    color: var(--accent);
}

/* Call to Action */
.consulta-preview {
    text-align: center;
    position: relative;
    overflow: hidden;
}

a {
    color: cornflowerblue;
}

.consulta-preview::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: conic-gradient(from 0deg at 50% 50%, transparent 0%, rgba(147, 51, 234, 0.2) 25%, transparent 50%);
    animation: rotate 10s linear infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

.consulta-preview p {
    color: var(--text-secondary);
    font-size: 1.2em;
    margin-bottom: 15px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white !important;
    padding: 16px 40px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    margin: 30px 0 10px;
    transition: var(--transition-normal);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.cta-button::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-slow);
}

.cta-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.6);
}

.cta-button:hover::before {
    left: 100%;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 30px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.breadcrumbs a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

.breadcrumbs a:hover {
    color: var(--text-primary);
    text-shadow: 0 0 8px rgba(255,255,255,0.5);
}

/* Post Details */
.post-content a[imageanchor] {
    float: none !important;
    display: block;
    margin: 0 auto !important;
    text-align: center;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 30px auto;
    display: block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
}

.post-content p {
    font-size: 1.15em;
    color: var(--text-secondary);
    margin-bottom: 1.5em;
    line-height: 1.8;
}

.post-content b, .post-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Tables */
.card-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.card-table th, .card-table td {
    padding: 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.card-table th {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 1px;
}

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

/* Tip Boxes */
.tip-box {
    background: rgba(147, 51, 234, 0.1);
    border-left: 4px solid var(--secondary);
    padding: 30px;
    margin: 40px 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    backdrop-filter: blur(10px);
}

.tip-box h4 {
    color: var(--text-primary);
    font-size: 1.3em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Navigation Links */
.card-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.nav-link, .back-link {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-pill);
    font-weight: 500;
    transition: var(--transition-normal);
    border: 1px solid var(--border-color);
}

.nav-link:hover, .back-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

/* Related Posts */
.related-posts {
    margin-top: 60px;
}

.related-posts h3 {
    font-size: 1.6em;
    color: var(--text-primary);
    margin-bottom: 25px;
}

.related-posts ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.related-posts li {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: var(--transition-normal);
}

.related-posts li:hover {
    background: rgba(147, 51, 234, 0.1);
    border-color: var(--secondary);
    transform: translateY(-4px);
}

.related-posts a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
}

/* Footer */
footer {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    header h1, header .site-title {
        font-size: 2.5em;
    }
    
    .posts-container, .post-content {
        padding: 25px;
    }
    
    .card-navigation {
        flex-direction: column;
    }
    
    .nav-link, .back-link {
        width: 100%;
        justify-content: center;
    }
}

/* =========================================
   Consulta Styles
   ========================================= */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
    gap: 15px 10px;
    margin: 30px 0;
    padding: 40px 10px;
    justify-content: center;
}

@media (max-width: 600px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
        gap: 12px 6px;
        padding: 25px 5px;
    }
}

.card-item {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
    position: relative;
}

.card-checkbox {
    display: none;
}

.card-item label {
    width: 100%;
    cursor: pointer;
    display: block;
    position: relative;
    z-index: 1;
}

.card-item img {
    width: 100%;
    height: auto;
    display: block;
    border: 2px solid transparent;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-item label:hover {
    z-index: 5;
}

.card-item label:hover img {
    transform: translateY(-8px) scale(1.05);
    border-color: var(--secondary);
    box-shadow: var(--shadow-glow);
}

.card-checkbox:checked+label {
    z-index: 10;
}

.card-checkbox:checked+label img {
    border-color: var(--accent);
    box-shadow: 0 15px 30px rgba(244, 63, 94, 0.5);
    transform: translateY(-15px) scale(1.12);
    filter: brightness(1.15) contrast(1.1);
}

.result-card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    margin-bottom: 30px;
    overflow: hidden;
    border-left: 6px solid var(--secondary);
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-normal);
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glass), var(--shadow-glow);
}

.result-card-header {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    padding: 15px 25px;
    font-weight: 700;
    font-size: 1.2em;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-card-body {
    display: flex;
    flex-wrap: wrap;
    padding: 30px;
}

.result-card-image {
    flex: 0 0 160px;
    text-align: center;
    margin-right: 40px;
    margin-bottom: 20px;
}

.result-card-image img {
    width: 140px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

.result-card-image strong {
    display: block;
    color: var(--primary);
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 10px;
}

.result-card-content {
    flex: 1;
    min-width: 280px;
}

.result-card-content p {
    line-height: 1.8;
    font-size: 1.1em;
    color: var(--text-secondary);
}

.consulta-header {
    text-align: center;
    margin-bottom: 40px;
}

.consulta-header p {
    text-align: center;
    margin-bottom: 20px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.1em;
    color: var(--text-secondary);
}

.consulta-header h1, .consulta-header h2 {
    color: var(--text-primary);
    font-size: 2.8em;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.selection-counter {
    font-weight: 800;
    color: var(--accent);
    font-size: 1.4em;
    text-shadow: 0 0 10px rgba(244, 63, 94, 0.3);
}

#result-section {
    display: none;
}

.consulta-container {
    padding: 50px 30px !important;
}

@media (max-width: 600px) {
    .consulta-container {
        padding: 30px 20px !important;
    }

    .result-card-image {
        flex: 0 0 100%;
        margin-right: 0;
    }

    .result-card-body {
        padding: 20px;
    }
    
    .consulta-header h1, .consulta-header h2 {
        font-size: 2em;
    }
}

/* =========================================
   404 Styles
   ========================================= */
.not-found-container {
    text-align: center;
    padding: 60px 20px;
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.not-found-container h2 {
    font-size: 5rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(244, 63, 94, 0.4);
}

.not-found-container p {
    font-size: 1.4rem;
    margin-bottom: 40px;
    color: var(--text-secondary);
}
