/* Modern Intranet Design - Crystal / Glassmorphism */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&family=Exo+2:wght@600;700&display=swap');

:root {
    --primary: #2563eb;
    /* Brighter blue */
    --secondary: #64748b;
    /* Slate text */
    --accent: #3b82f6;
    /* Vivid blue accent */
    --text-color: #1e293b;
    /* Dark slate for text */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --nav-bg: rgba(255, 255, 255, 0.25);
    /* Light glass for nav */
    --nav-border: rgba(255, 255, 255, 0.4);
}

body {
    font-family: 'Montserrat', sans-serif;
    /* Soft gradient background */
    background: linear-gradient(135deg, #e0e7ff 0%, #f3e7e9 100%);
    background-attachment: fixed;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    font-size: 14px;
    min-height: 100vh;
}

header {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.75rem 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-logo {
    height: 35px;
    margin-right: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
}

header h1 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

/* Crystal Nav - Now Light and Glassy */
nav {
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-color);
    /* Dark text for light bg */
    padding: 0.5rem 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 900;
    margin: 1rem 1rem 0 1rem;
    border-radius: 16px;
    border: 1px solid var(--nav-border);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

.dropdown {
    position: relative;
    display: inline-block;
}

.nav-btn {
    color: var(--secondary);
    /* Slate text */
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Hover effect: white glass */
.nav-btn:hover,
.dropdown.active .nav-btn {
    color: var(--primary);
    background-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Glass Submenu */
.submenu {
    display: none;
    position: absolute;
    top: 110%;
    /* Slight gap */
    left: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    min-width: 220px;
    box-shadow: var(--glass-shadow);
    border-radius: 10px;
    overflow: hidden;
    z-index: 1100;
    border: 1px solid var(--glass-border);
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown.active .submenu {
    display: block;
}

.submenu a {
    color: var(--text-color);
    padding: 10px 14px;
    text-decoration: none;
    display: block;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.submenu a:hover {
    background: rgba(37, 99, 235, 0.1);
    /* Light blue tint */
    color: var(--primary);
}

.container {
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

/* Glass News Cards */
/* Glass News Cards */
.noticias-normales-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /* Match Important Grid */
    gap: 1.5rem;
    /* Match Important Grid Gap */
}

/* Important News: 3-Card Grid with Pop-up */
.importantes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    /* Height removed to allow auto-expansion */
}

.importante-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    padding: 1rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

/* Image in zoomed card */
.importante-card img,
.importante-card video {
    width: 100%;
    height: 300px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    background-color: rgba(0, 0, 0, 0.03);
    /* Subtle background for letterboxing */
}

.importante-card h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin: 0.5rem 0;
}

.importante-card p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Hover Effect - Scale Only */
.importante-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.2);
}

/* Divider */
.news-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
    margin: 3rem 0;
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.news-divider::after {
    content: '•';
    background: var(--bg-color);
    /* Fallback */
    padding: 0 10px;
    color: var(--secondary);
    font-size: 1.5rem;
    position: absolute;
}

/* Divider */
.news-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
    margin: 3rem 0;
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.news-divider::after {
    content: '•';
    background: var(--bg-color);
    /* Fallback */
    padding: 0 10px;
    color: var(--secondary);
    font-size: 1.5rem;
    position: absolute;
}

/* Popup Styles Removed */

.noticia-box {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    /* More visible border */
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    /* Deeper shadow base */
    padding: 1rem;
    /* Reduced padding */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.noticia-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.2);
}

.noticia-box h3 {
    margin-top: 0;
    color: var(--primary);
    font-size: 1.1rem;
    /* Match Important H3 */
    margin-bottom: 0.5rem;
    font-weight: 700;
}

/* Default image style - STANDARD HEIGHT 180px */
.noticia-box img,
.noticia-box video {
    max-width: 100%;
    width: 100%;
    height: 250px;
    object-fit: contain;
    border-radius: 10px;
    margin: 0.5rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: rgba(0, 0, 0, 0.03);
}

/* Removed Compact Grid Images override since base style now matches */

/* Video Wrapper */
.video-wrapper {
    margin: 0.5rem 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Comments Section - Glassy */
.comments-section {
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 1rem;
}

.comment-list {
    margin-bottom: 0.75rem;
    max-height: 150px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom Scrollbar */
.comment-list::-webkit-scrollbar {
    width: 6px;
}

.comment-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.comment-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.comment-item {
    padding: 0.6rem;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.5);
    /* Lighter glass */
    margin-bottom: 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.comment-author {
    font-weight: 600;
    color: var(--primary);
    display: block;
    margin-bottom: 0.1rem;
    font-size: 0.8rem;
}

/* Inputs & Buttons */
.comment-form textarea {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.6rem;
    font-family: inherit;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.8);
    box-sizing: border-box;
    transition: all 0.2s;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.comment-form button,
.reaccion-btn {
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.comment-form button {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.comment-form button:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
}

/* Reactions */
.reaccion-btn {
    background: rgba(255, 255, 255, 0.5);
    color: #333;
    border: 1px solid transparent;
}

.reaccion-btn:hover {
    background: white;
    transform: scale(1.05);
}

.reaccion-btn.activa {
    background: #eff6ff;
    border-color: var(--accent);
    color: var(--primary);
}

/* Carousel Buttons */
#prevNoticia,
#nextNoticia {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    color: #333;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 10px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

/* --- GLOBAL FORM STYLES --- */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
textarea,
select,
input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    font-family: inherit;
    box-sizing: border-box;
    /* Ensure padding doesn't overflow width */
    transition: all 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* --- ADMIN / DASHBOARD LAYOUTS --- */
.admin-layout {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.admin-col-main {
    flex: 2;
    min-width: 300px;
}

.admin-col-sidebar {
    flex: 1;
    min-width: 300px;
}

.admin-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    padding: 1.5rem;
}

/* --- LOGIN PAGE STYLES --- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-glass-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    max-width: 180px;
    margin-bottom: 1.5rem;
}

.login-glass-card h2 {
    color: var(--primary);
    margin-bottom: 2rem;
    font-weight: 700;
}

.login-glass-card button {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
    transition: background 0.2s;
}

.login-glass-card button:hover {
    background: #1d4ed8;
}

/* --- BADGES & UTILS --- */
.badge-imp {
    background: var(--accent);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    vertical-align: middle;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: white;
    color: var(--primary);
}

.btn {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #1d4ed8;
}

/* Mini button for sharing */
.btn-mini {
    background: transparent;
    border: 1px solid rgba(37, 99, 235, 0.2);
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-mini:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}