:root {
    --primary-color: #701833;      /* Guinda Gobierno */
    --secondary-color: #b38e5d;    /* Dorado/Tan */
    --text-color: #333;
    --bg-color: #f8f9fa;
    --sidebar-width: 280px;
    --header-height: 60px;
    --border-color: #e0e0e0;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
aside.sidebar {
    width: var(--sidebar-width);
    background: #fff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 200;
    transition: var(--transition);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.sidebar-header img {
    max-width: 80%;
    height: auto;
}

nav.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: #555;
    text-decoration: none;
    font-size: 0.95rem;
    border-left: 4px solid transparent;
    transition: var(--transition);
}

.nav-item:hover {
    background: #f0f0f0;
    color: var(--primary-color);
}

.nav-item.active {
    background: #fff5f7;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.nav-item i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

/* Top Header */
header.top-bar {
    height: var(--header-height);
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 99;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    color: #fff;
}

/* Responsive Queries */
@media (max-width: 992px) {
    aside.sidebar {
        left: -281px; /* Fallback for var width */
        left: calc(var(--sidebar-width) * -1);
    }
    
    aside.sidebar.active {
        left: 0 !important;
    }

    header.top-bar {
        left: 0;
    }

    .menu-toggle {
        display: block;
    }

    main.content {
        margin-left: 0 !important;
        padding: 20px;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 150;
        transition: var(--transition);
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-profile span {
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Main Content */
main.content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 40px;
    flex: 1;
}

.card {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

h1, h2, h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #444;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: var(--transition);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(112, 24, 51, 0.1);
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    border: none;
}

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

.btn-primary:hover {
    background: #5a1228;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* Profile View */
.profile-header {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.profile-photo {
    width: 180px;
    height: 180px;
    border-radius: 12px;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.profile-info {
    flex: 1;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-pending { background: #ffeeba; color: #856404; }
.badge-approved { background: #c3e6cb; color: #155724; }

/* Honeycomb / Geometric Layout */
.honeycomb-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    margin: 40px auto;
    gap: 20px 40px; /* Vertical gap, Horizontal gap */
    padding: 20px;
}

.member-item {
    width: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    transition: var(--transition);
}

/* Dynamic Staggering Effect */
/* Every second hexagon in a continuous flow will be slightly offset 
   to simulate the geometric interlocking regardless of row wrap. */
.member-item:nth-child(even) {
    transform: translateY(60px);
}

.hexagon-photo {
    width: 240px;
    height: 220px; /* Adjusted for flat-top height/width ratio */
    background: #fff;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    border: 4px solid var(--primary-color);
    margin-bottom: 20px;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hexagon-photo:hover {
    transform: scale(1.1);
    z-index: 10;
}

.hexagon-img-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hexagon-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-info {
    text-align: center;
    background: rgba(255,255,255,0.9);
    padding: 5px 10px;
    border-radius: 4px;
    z-index: 2;
}

.member-info h4 {
    font-size: 1rem;
    color: var(--primary-color);
    text-transform: uppercase;
    margin-bottom: 3px;
    border-bottom: 2px solid var(--secondary-color);
    display: inline-block;
}

.member-info p {
    font-size: 0.85rem;
    color: #444;
    font-weight: 600;
}

/* Ensure container has enough bottom padding for the offset */
.honeycomb-container {
    padding-bottom: 100px;
}

/* Modal Simple */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #fff;
    margin: 5% auto;
    padding: 30px;
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

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

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 2rem;
    cursor: pointer;
    color: #aaa;
}

.close-modal:hover { color: #333; }

/* Directorio de Recursos */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.resource-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    border-top: 5px solid var(--secondary-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.resource-category {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.resource-card h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: #222;
}

.resource-card p {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
    flex: 1;
}

.resource-card .btn {
    padding: 8px 15px;
    font-size: 0.8rem;
    text-align: center;
}
