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

:root {
    --primary-color: #9b59b6;
    --secondary-color: #3498db;
    --danger-color: #e74c3c;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --border: #bdc3c7;
    --online: #2ecc71;
    --offline: #95a5a6;
    --text: #2c3e50;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 40px;
}

/* Navegación principal */
.main-nav {
    display: flex;
    gap: 5px;
    background: #2c3e50;
    padding: 10px 15px;
    border-radius: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.main-nav a {
    color: #bdc3c7;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    background: #9b59b6;
    color: white;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 20px;
}

.header h1 {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1em;
    color: #666;
}

/* Sección de búsqueda */
.search-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.search-section h2 {
    margin-bottom: 20px;
    color: var(--dark);
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-form input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-search {
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(155, 89, 182, 0.4);
}

/* Alertas */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-top: 15px;
}

.alert-error {
    background: #ffe6e6;
    border-left: 4px solid var(--danger-color);
    color: #c0392b;
}

/* Información del Modelo */
.model-info-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.model-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.model-avatar {
    width: 200px;
    height: 200px;
    border-radius: 10px;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.no-avatar,
.model-card-avatar-placeholder {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4em;
}

.model-details {
    flex: 1;
    min-width: 300px;
}

.model-details h2 {
    font-size: 2em;
    margin-bottom: 15px;
    color: var(--dark);
}

.model-status {
    margin-bottom: 20px;
}

.status-badge {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
}

.status-public,
.status-online {
    background: #d4edda;
    color: #155724;
}

.status-private {
    background: #fff3cd;
    color: #856404;
}

.status-away {
    background: #fff3cd;
    color: #856404;
}

.status-offline {
    background: #e2e3e5;
    color: #383d41;
}

.model-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.meta-item {
    font-size: 0.95em;
    padding: 5px 10px;
    background: white;
    border-radius: 5px;
    border: 1px solid var(--border);
}

.model-bio {
    background: white;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid var(--primary-color);
}

.model-bio p {
    margin-top: 10px;
    line-height: 1.6;
}

/* Botones de acción */
.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

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

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

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

.btn-secondary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.2);
}

.btn-danger {
    color: var(--danger-color);
}

/* Sección de Estadísticas */
.stats-section {
    margin: 30px 0;
}

.stats-section h2 {
    margin-bottom: 20px;
    color: var(--dark);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-card h3 {
    font-size: 0.9em;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-top: 20px;
}

/* Tiempo Real */
.realtime-container {
    padding: 20px;
}

.realtime-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 20px;
}

.realtime-header h1 {
    color: var(--primary-color);
}

.header-controls {
    display: flex;
    gap: 10px;
}

/* Filtros */
.filters-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: bold;
    font-size: 0.9em;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.95em;
}

/* Overview Stats */
.overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid var(--border);
    text-align: center;
}

.stat-box h3 {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-time {
    font-size: 0.95em;
    color: #666;
}

/* Grid de Modelos */
.models-grid-section h2 {
    margin-bottom: 20px;
}

.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.model-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.model-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border);
}

.model-card-header h3 {
    font-size: 1.1em;
    margin: 0;
}

.model-card-avatar {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.model-card-avatar-placeholder {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
}

.model-card-info {
    padding: 15px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--light);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    font-weight: bold;
    color: #666;
    font-size: 0.9em;
}

.info-row .value {
    color: var(--dark);
}

.model-card-actions {
    display: flex;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid var(--border);
    justify-content: space-around;
}

/* Estado vacío */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 1.2em;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: slideDown 0.3s;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--danger-color);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .model-header {
        flex-direction: column;
        align-items: center;
    }

    .search-form {
        flex-direction: column;
    }

    .models-grid {
        grid-template-columns: 1fr;
    }

    .realtime-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .header-controls {
        flex-direction: column;
        width: 100%;
    }

    .header-controls .btn {
        width: 100%;
    }

    .filters-section {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }
}
