/* CSS Variables */
:root {
    --primary-color: #dc3545;
    --primary-light: #e35d6a;
    --secondary-color: #6c757d;
    --secondary-light: #868e96;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --background-gradient: linear-gradient(135deg, var(--primary-color) 40%, white 100%);
    --navbar-stripe: 4px solid var(--primary-color);
    --bs-success: #198754;
    --bs-success-dark: #157347;
    --bs-secondary: #6c757d;
    --bs-secondary-dark: #565e64;
}

/* Global Styles with Smooth Transitions */
* {
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background: #343a40 !important;
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-bottom: var(--navbar-stripe);
}

.navbar > .container-fluid {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    flex: 0 0 auto;
    margin-right: 2rem;
    font-weight: 500;
    color: #fff !important;
    display: flex;
    align-items: center;
    white-space: nowrap;
    font-size: 1.2rem;
}

.navbar-brand img {
    height: 35px;
    margin-right: 0.75rem;
}

#navbarNav {
    display: flex;
    justify-content: center;
    flex: 1;
}

.navbar-nav.mx-auto {
    margin: 0 auto;
}

.navbar-nav:last-child {
    flex: 0 0 auto;
    margin-left: 2rem;
}

.nav-link {
    color: rgba(255,255,255,0.85) !important;
    transition: all 0.2s ease;
    padding: 0.75rem 1rem;
    white-space: nowrap;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.nav-link:hover {
    color: #fff !important;
    background-color: var(--primary-color);
    border-radius: 4px;
    transform: translateY(-1px);
}

.nav-link i {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-right: 0.5rem;
}

.dropdown-menu {
    background-color: #343a40;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    padding: 0.5rem;
    margin-top: 0.5rem;
    border-radius: 8px;
    min-width: 200px;
}

.dropdown-item {
    color: rgba(255,255,255,0.85) !important;
    font-size: 0.9rem;
    font-weight: 400;
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: #fff !important;
    transform: translateX(3px);
}

.dropdown-item i {
    margin-right: 0.75rem;
    width: 1.25rem;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.9;
}

.dropdown-divider {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 0.5rem 0;
}

/* Container */
.container {
    max-width: 1320px !important;
    margin: 0 auto !important;
}

/* Cards */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem;
}

.card-header .card-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h5 {
    margin: 0;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
}

.card-header h5 i {
    margin-right: 0.75rem;
    color: var(--primary-color);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: none;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 1.5rem;
}

/* Dashboard Stats Cards */
.stats-card {
    position: relative;
    padding: 1.5rem;
    border-radius: 0.5rem;
    color: white;
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.75rem 1.5rem rgba(0,0,0,0.2);
}

.stats-card.blue {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-light));
}

.stats-card.green {
    background: linear-gradient(45deg, #1cc88a, #13855c);
}

.stats-card.cyan {
    background: linear-gradient(45deg, #36b9cc, #258391);
}

.stats-card.yellow {
    background: linear-gradient(45deg, #f6c23e, #dda20a);
}

.stats-card .title {
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    color: rgba(255,255,255,0.8);
}

.stats-card .value {
    font-size: 2rem;
    font-weight: bold;
    margin: 0.5rem 0;
    color: white;
}

.stats-card .link {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.stats-card .link:hover {
    opacity: 1;
}

.stats-card .icon {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    font-size: 4rem;
    opacity: 0.2;
    color: white;
    transition: transform 0.3s ease;
}

.stats-card:hover .icon {
    transform: scale(1.1) rotate(10deg);
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    padding: 1rem;
    background-color: #f8f9fa;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

.table-hover tbody tr {
    transition: background-color 0.2s ease;
}

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

.list-group-item {
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 1.5rem;
    transition: background-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-group-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.list-group-item:last-child {
    border-bottom: none;
}

.militante-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.militante-info h6 {
    margin: 0;
    color: #333;
    font-weight: 500;
}

.militante-info small {
    color: var(--secondary-color);
    margin-top: 0.25rem;
}

/* Buttons */
.alert {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* Badges */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
    border-radius: 0.375rem;
}

.text-muted {
    color: var(--secondary-color) !important;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: 0.5rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 1rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1rem;
}

/* Login Page */
.login-page {
    background: var(--background-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.5s ease;
}

.login-logo {
    height: 60px;
    width: auto;
    margin-bottom: 1rem;
}

.login-title {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.welcome-header {
    margin-bottom: 2rem;
}

.page-wrapper {
    padding: 2rem 1rem;
    min-height: calc(100vh - 70px);
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Skeleton Loaders */
.skeleton-loader {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.skeleton-row {
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: 10px;
    border-radius: 4px;
}

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

/* Responsive Design */
@media (max-width: 1400px) {
    .container {
        max-width: 1140px !important;
    }
}

@media (max-width: 1200px) {
    .container {
        max-width: 960px !important;
    }
    .page-wrapper {
        padding: 1.5rem 0.75rem;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 720px !important;
    }
}

@media (max-width: 768px) {
    .navbar-collapse {
        background-color: #343a40;
        padding: 1rem;
        border-radius: 0 0 10px 10px;
        margin-top: 0.5rem;
    }
    
    .navbar-brand img {
        height: 30px;
    }

    .dropdown-menu {
        background-color: rgba(0,0,0,0.2);
        margin-left: 1rem;
        min-width: auto;
    }

    .nav-link {
        padding: 0.5rem 1rem;
    }

    .navbar-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .container {
        max-width: 540px !important;
    }
    
    .page-wrapper {
        padding: 1rem 0.5rem;
    }

    .stats-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .page-wrapper {
        padding: 0.75rem 0.25rem;
    }
}
