:root {
    --primary-color: #2e3856;
    --secondary-color: #245074;
    --accent-color: #e67e22;
    --text-dark: #2d3436;
    --text-muted: #636e72;
    --bg-light: #f8f9fa;
    --card-bg: #ffffff;
    --border-radius: 16px;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);

    /* Overrides needed */
    --gradient-primary: var(--primary-color);
    --gradient-success: #28a745;
}

body {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #f4f7f6;
}

.text-a-primary,
h1,
.h1,
h2,
.h2,
h3,
.h3,
h4,
.h4,
.text-primary {
    color: var(--primary-color) !important;
}

/* Hero Section */
.hero-section {
    background: var(--primary-color);
    color: white;
    padding: 5rem 0 4rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Unit Cards */
.unit-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.03);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.unit-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.image-container {
    position: relative;
    height: 220px !important;
    /* Altura fixa para consistência */
    overflow: hidden;
}

.image-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0.8;
}

.unit-card .image-container {
    transition: var(--transition);
}

.unit-card:hover .image-container {
    transform: scale(1.02);
}

.status-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
}

.status-active {
    background: rgba(40, 167, 69, 0.9);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.status-archive {
    background: rgba(108, 117, 125, 0.9);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: white;
    /* Ensure solid background over image zoom */
    position: relative;
    /* Context for z-index */
    z-index: 3;
}

.unit-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.4;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 60px;
}

.btn-ler-mais {
    width: 100%;
    border-radius: 50px;
    padding: 10px 20px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    transition: var(--transition);
    background: var(--primary-color);
    border: none;
    box-shadow: 0 4px 15px rgba(44, 90, 160, 0.3);
}

.btn-ler-mais:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 90, 160, 0.4);
    background: var(--secondary-color);
}

/* Tabs */
.custom-tabs {
    margin: 0 auto 3rem;
    background: white;
    padding: 0.5rem;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.custom-tabs .nav-link {
    border: none;
    border-radius: 50px !important;
    padding: 10px 30px;
    margin: 0 5px;
    color: var(--text-muted);
    font-weight: 600;
    transition: all 0.3s ease;
    background: transparent;
}

.custom-tabs .nav-link:hover {
    color: var(--primary-color);
    background: rgba(44, 90, 160, 0.05);
}

.custom-tabs .nav-link.active {
    background: var(--primary-color) !important;
    color: white;
    box-shadow: 0 4px 10px rgba(44, 90, 160, 0.3);
}

.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Animations */
.fade-in {
    animation: fadeInUp 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading State */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.25em;
}

/* Fallback Image */
.image-fallback {
    height: 220px;
    background: #f8f9fa;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
}

/* Responsividade */
@media (max-width: 768px) {
    .custom-tabs {
        display: flex;
        width: 100%;
        border-radius: 12px;
        left: 0;
        transform: none;
        flex-direction: column;
    }

    .custom-tabs .nav-link {
        width: 100%;
        margin: 5px 0;
        text-align: center;
    }

    .card-title {
        font-size: 1rem;
    }
}