/**
 * Aroropiology - Main CSS
 * 
 * Estilos principales del proyecto
 * Incluye variables CSS para theming dinámico
 */

/* Variables CSS para theming */
:root {
    /* Colores base */
    --color-bg-dark: #121212;
    --color-bg-light: #fafafa;
    --color-text-primary-dark: #e0e0e0;
    --color-text-primary-light: #333333;
    --color-text-secondary-dark: #b0b0b0;
    --color-text-secondary-light: #666666;
    
    /* Colores de acento */
    --color-primary: #3b82f6;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    
    /* Colores por rol */
    --color-admin: #8b5cf6;
    --color-reviewer: #06b6d4;
    --color-author: #10b981;
    --color-reader: #6b7280;
    
    /* Espaciado */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Tipografía */
    --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    --font-family-mono: 'JetBrains Mono', 'Monaco', 'Cascadia Code', monospace;
    
    /* Tamaños de fuente */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    
    /* Bordes y sombras */
    --border-radius: 0.375rem;
    --border-width: 1px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Configuración base del body */
body {
    font-family: var(--font-family-sans);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text-primary-light);
    background-color: var(--color-bg-light);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Modo oscuro por defecto para roles de contenido */
body.dark-mode {
    background-color: var(--color-bg-dark);
    color: var(--color-text-primary-dark);
}

/* Contenedores */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container-sm {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--spacing-md);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }

p {
    margin-bottom: var(--spacing-md);
}

/* Flash Messages */
.flash-message {
    position: fixed;
    top: calc(var(--header-height, 60px) + var(--spacing-md));
    right: var(--spacing-md);
    max-width: 400px;
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideInRight 0.3s ease;
}

body.dark-mode .flash-message {
    background: var(--color-bg-dark);
}

.flash-success {
    border-left: 4px solid var(--color-success);
}

.flash-error {
    border-left: 4px solid var(--color-danger);
}

.flash-warning {
    border-left: 4px solid var(--color-warning);
}

.flash-info {
    border-left: 4px solid var(--color-primary);
}

.flash-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
}

.flash-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.flash-text {
    flex: 1;
    color: var(--color-text-primary-light);
    font-weight: 500;
}

body.dark-mode .flash-text {
    color: var(--color-text-primary-dark);
}

.flash-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--color-text-secondary-light);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

body.dark-mode .flash-close {
    color: var(--color-text-secondary-dark);
}

.flash-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--color-text-primary-light);
}

body.dark-mode .flash-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary-dark);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Auto-hide flash messages */
.flash-message {
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 4.7s forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Enlaces */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary);
    opacity: 0.8;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-base);
    font-weight: 500;
    border: var(--border-width) solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 2.5rem;
}

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

.btn-primary:hover {
    background-color: var(--color-primary);
    opacity: 0.9;
    color: white;
}

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

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

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

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

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

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.875rem;
    min-height: 2rem;
}

.btn-icon {
    font-size: 1rem;
    margin-right: var(--spacing-xs);
}

/* Public Actions in Header */
.public-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.theme-toggle-public {
    background: none;
    border: none;
    padding: var(--spacing-sm);
    border-radius: 50%;
    cursor: pointer;
    color: var(--color-text-secondary-light);
    transition: all 0.2s ease;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
}

body.dark-mode .theme-toggle-public {
    color: var(--color-text-secondary-dark);
}

.theme-toggle-public:hover {
    background: var(--color-bg-secondary-light);
    color: var(--color-text-primary-light);
}

body.dark-mode .theme-toggle-public:hover {
    background: var(--color-bg-secondary-dark);
    color: var(--color-text-primary-dark);
}

/* Formularios */
.form-group {
    margin-bottom: var(--spacing-lg);
}

label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--color-text-primary-light);
}

.dark-mode label {
    color: var(--color-text-primary-dark);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: var(--border-width) solid #d1d5db;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: white;
}

.dark-mode input[type="text"],
.dark-mode input[type="email"],
.dark-mode input[type="password"],
.dark-mode input[type="url"],
.dark-mode input[type="tel"],
.dark-mode textarea,
.dark-mode select {
    background-color: #374151;
    border-color: #4b5563;
    color: var(--color-text-primary-dark);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Mensajes Flash */
.flash-messages {
    margin-bottom: var(--spacing-lg);
}

.flash-message {
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
}

.flash-success {
    background-color: #d1fae5;
    color: #065f46;
    border: var(--border-width) solid #10b981;
}

.flash-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: var(--border-width) solid #ef4444;
}

.flash-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: var(--border-width) solid #f59e0b;
}

.flash-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: var(--border-width) solid #3b82f6;
}

/* Cards */
.card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: var(--border-width) solid #e5e7eb;
    overflow: hidden;
}

.dark-mode .card {
    background-color: #1f2937;
    border-color: #374151;
}

.card-header {
    padding: var(--spacing-lg);
    border-bottom: var(--border-width) solid #e5e7eb;
    background-color: #f9fafb;
}

.dark-mode .card-header {
    background-color: #111827;
    border-color: #374151;
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-lg);
    border-top: var(--border-width) solid #e5e7eb;
    background-color: #f9fafb;
}

.dark-mode .card-footer {
    background-color: #111827;
    border-color: #374151;
}

/* Utilidades */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

/* Responsive */
@media (max-width: 768px) {
    .container,
    .container-sm {
        padding: 0 var(--spacing-sm);
    }
    
    h1 { font-size: var(--font-size-2xl); }
    h2 { font-size: var(--font-size-xl); }
    h3 { font-size: var(--font-size-lg); }
}
