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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
}

/* Navegación */
.navbar {
    background: #3e5292;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 70px;
}

.nav-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.user-avatar {
    position: relative;
    cursor: pointer;
}

.user-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
}

.username {
    color: white;
    font-weight: 500;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    padding: 10px 0;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-avatar:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s ease;
}

.user-dropdown a:hover {
    background: #f8f9fa;
}

.user-dropdown hr {
    margin: 5px 0;
    border: none;
    height: 1px;
    background: #eee;
}

/* Contenido principal */
.main-content {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    min-height: calc(100vh - 160px);
}

.content-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

/* Formularios */
.form-container {
    max-width: 500px;
    margin: 50px auto;
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.form-title {
    text-align: center;
    color: #3e5292;
    margin-bottom: 30px;
    font-size: 2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: #3e5292;
    outline: none;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #3e5292;
    color: white;
}

.btn-primary:hover {
    background: #2d3f73;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-block {
    display: block;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
}

.content-card .btn + .btn,
.content-card .btn + a {
    margin-top: 12px; /* separa botones apilados */
}

.cancel-btn {
    text-align: center;
}


/* Alertas */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* Buscador */
.search-container {
    position: relative;
    margin-bottom: 30px;
}

.search-box {
    width: 100%;
    padding: 15px 20px;
    font-size: 18px;
    border: 2px solid #e1e5e9;
    border-radius: 15px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.search-box:focus {
    border-color: #3e5292;
    outline: none;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.search-result-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-result-item:hover {
    background: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: 600;
    color: #3e5292;
    margin-bottom: 5px;
}

.search-result-excerpt {
    color: #666;
    font-size: 14px;
}

/* Artículos */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.article-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.article-image {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.article-content {
    padding: 20px;
}

.article-title {
    color: #3e5292;
    font-size: 1.3rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.article-title a {
    color: inherit;
    text-decoration: none;
}

.article-title a:hover {
    color: #2d3f73;
}

.article-excerpt {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #888;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-stats {
    display: flex;
    gap: 15px;
}

.article-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: 20px;
    padding: 15px 20px;
    background: rgba(255,255,255,0.8);
    border-radius: 10px;
    font-size: 14px;
}

.breadcrumbs a {
    color: #3e5292;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs span {
    margin: 0 5px;
    color: #888;
}

/* Footer */
.footer {
    background: #3e5292;
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
}

.footer-content p {
    margin: 5px 0;
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 15px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .form-container {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .main-content {
        padding: 0 15px;
        margin: 20px auto;
    }
    
    .content-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        gap: 10px;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .form-title {
        font-size: 1.5rem;
    }
    
    .article-content {
        padding: 15px;
    }
    
    .search-box {
        padding: 12px 15px;
        font-size: 16px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-card, .article-card {
    animation: fadeIn 0.6s ease;
}

/* Utilidades */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.p-0 { padding: 0; }
.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.hidden { display: none; }
.visible { display: block; }

/* Loading spinner */
.spinner {
    border: 3px solid rgba(62, 82, 146, 0.3);
    border-radius: 50%;
    border-top: 3px solid #3e5292;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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