/* ============================================
   BLOG CSS - ADAPTADO AL ESTILO FARMACÉUTICO
   ============================================ */

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header estilo farmacéutico */
.header {
    background: linear-gradient(135deg, #0C71C3 0%, #0084de 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1rem 0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.logo img {
    max-height: 50px;
    width: auto;
}

.admin-btn {
    padding: 10px 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 25px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.admin-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* Grid de artículos estilo productos */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #eee;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s;
}

.article-card:hover .article-image {
    transform: scale(1.05);
}

.article-content {
    padding: 20px;
}

.article-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #0C71C3;  /* Azul principal */
    font-weight: 600;
    transition: color 0.3s ease;
}

.article-card:hover .article-title {
    color: #0084de;  /* Azul más claro al hacer hover */
}

.article-summary {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #999;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* Reacciones estilo farmacéutico */
.reactions {
    display: flex;
    gap: 10px;
}

.reaction-btn {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.reaction-btn:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: scale(1.05);
}

.share-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    transition: transform 0.2s;
}

.share-btn:hover {
    transform: scale(1.1);
}

/* Modal estilo farmacéutico */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 30px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 12px;
    position: relative;
    animation: slideIn 0.3s;
    border-top: 4px solid #0084de;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.close:hover {
    color: #0C71C3;
}

/* Panel de administración */
.admin-panel {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-top: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border: 1px solid #eee;
}

.admin-panel h2 {
    color: #0C71C3;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0084de;
    display: inline-block;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
    outline: none;
    border-color: #0084de;
    box-shadow: 0 0 0 2px rgba(0,132,222,0.1);
}

.admin-form textarea {
    min-height: 300px;
}

/* Botones estilo farmacéutico */
.btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #0C71C3 0%, #0084de 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0,132,222,0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.btn-danger:hover {
    box-shadow: 0 5px 10px rgba(220,53,69,0.3);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.btn-success:hover {
    box-shadow: 0 5px 10px rgba(40,167,69,0.3);
}

/* Footer estilo farmacéutico */
.footer {
    background: linear-gradient(135deg, #0C71C3 0%, #0084de 100%);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer p {
    margin: 5px 0;
    opacity: 0.9;
}

/* Lista de artículos */
.article-list {
    margin-top: 30px;
}

.article-list h3 {
    color: #0C71C3;
    margin-bottom: 15px;
}

.article-item {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    border: 1px solid #eee;
}

.article-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

/* Mensajes de notificación */
.message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: slideIn 0.3s;
}

.message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
}

/* Editor de contenido */
.editor-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.editor-toolbar button {
    padding: 8px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.editor-toolbar button:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateY(-1px);
}

.image-upload-area {
    border: 2px dashed #0084de;
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    margin: 15px 0;
    cursor: pointer;
    transition: all 0.3s;
}

.image-upload-area:hover {
    background: #e9ecef;
    border-color: #0C71C3;
}

/* Contenido completo del artículo */
.article-full-content {
    line-height: 1.8;
}

.article-full-content img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    border-radius: 8px;
}

.article-full-content h2 {
    color: #0C71C3;
    margin: 20px 0 10px;
}

.article-full-content p {
    margin-bottom: 15px;
}

/* Utilidades de alineación */
.float-left {
    float: left;
    margin: 0 15px 15px 0;
}

.float-right {
    float: right;
    margin: 0 0 15px 15px;
}

.center {
    display: block;
    margin: 15px auto;
}

/* Login container */
.login-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0); 
        opacity: 1; 
    }
}

/* Responsive design */
@media (max-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
        padding: 20px;
    }
    
    .article-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .editor-toolbar {
        justify-content: center;
    }
    
    .reactions {
        flex-wrap: wrap;
    }
    
    .admin-panel {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .article-title {
        font-size: 1.1rem;
    }
    
    .article-image {
        height: 180px;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .reaction-btn {
        padding: 3px 8px;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* Scroll personalizado */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0C71C3 0%, #0084de 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0084de 0%, #0C71C3 100%);
}

/* Estilos para impresión */
@media print {
    .header, .footer, .admin-btn, .reactions, .share-btn {
        display: none;
    }
    
    .article-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .modal-content {
        position: static;
        margin: 0;
        padding: 0;
    }
}