/* Admin Styles */
:root {
    --admin-primary: #1a4d3a;
    --admin-secondary: #2d5a47;
    --admin-accent: #4a9b7a;
    --admin-dark: #0a1a14;
    --admin-light: #f5f5f5;
    --admin-border: #e0e0e0;
    --admin-text: #333;
    --admin-text-light: #666;
    --admin-success: #28a745;
    --admin-error: #dc3545;
    --admin-warning: #ffc107;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--admin-light);
    color: var(--admin-text);
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--admin-dark) 0%, var(--admin-primary) 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    height: 60px;
    width: auto;
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.8rem;
    color: var(--admin-primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--admin-text-light);
    font-size: 0.9rem;
}

.login-form {
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--admin-text);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--admin-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(74, 155, 122, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--admin-text-light);
    font-size: 0.85rem;
}

.btn-login-submit {
    width: 100%;
    padding: 0.875rem;
    background: var(--admin-accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.btn-login-submit:hover {
    background: #3a8a6a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 155, 122, 0.3);
}

.btn-login-submit:active {
    transform: translateY(0);
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--admin-border);
}

.login-footer a {
    color: var(--admin-accent);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.login-footer a:hover {
    color: var(--admin-primary);
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #fee;
    color: var(--admin-error);
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: var(--admin-success);
    border: 1px solid #cfc;
}

/* Admin Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 280px;
    background: var(--admin-dark);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    height: 50px;
    width: auto;
    margin-bottom: 1rem;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    color: var(--admin-accent);
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-left-color: var(--admin-accent);
}

.nav-item.active {
    background: rgba(74, 155, 122, 0.1);
    color: var(--admin-accent);
    border-left-color: var(--admin-accent);
}

.nav-item span {
    font-size: 1.2rem;
}

.admin-main {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
}

.admin-header {
    background: white;
    padding: 2rem;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 1.8rem;
    color: var(--admin-primary);
}

.admin-user {
    color: var(--admin-text-light);
    font-size: 0.9rem;
}

.admin-content {
    padding: 2rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease;
}

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

.stat-icon {
    font-size: 3rem;
}

.stat-info h3 {
    font-size: 2rem;
    color: var(--admin-accent);
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--admin-text-light);
    font-size: 0.9rem;
}

/* Content Section */
.content-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--admin-border);
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--admin-primary);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background: #3a8a6a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 155, 122, 0.3);
}

.btn-secondary {
    background: var(--admin-border);
    color: var(--admin-text);
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.btn-edit {
    background: var(--admin-accent);
    color: white;
}

.btn-edit:hover {
    background: #3a8a6a;
}

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

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

/* Table */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--admin-light);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--admin-text);
    border-bottom: 2px solid var(--admin-border);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--admin-border);
}

.data-table tbody tr:hover {
    background: var(--admin-light);
}

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

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: var(--admin-success);
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--admin-border);
}

.tab {
    padding: 1rem 2rem;
    text-decoration: none;
    color: var(--admin-text-light);
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    top: 2px;
}

.tab:hover {
    color: var(--admin-primary);
}

.tab.active {
    color: var(--admin-primary);
    border-bottom-color: var(--admin-accent);
}

/* Article Form */
.article-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--admin-border);
}

/* Responsive */
@media (max-width: 968px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

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

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Redes Sociales Grid */
.social-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.social-media-item {
    background: white;
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.social-media-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.social-media-header {
    margin-bottom: 1rem;
}

.social-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--admin-text);
}

.social-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--admin-accent);
}

.social-name {
    font-size: 1rem;
    font-weight: 600;
}

.social-media-input {
    width: 100%;
}

.social-url-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.social-url-input:focus {
    outline: none;
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(74, 155, 122, 0.1);
}

@media (max-width: 768px) {
    .social-media-grid {
        grid-template-columns: 1fr;
    }
}

/* Equipo form - form rows and dynamic sections */
.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 0.75rem;
}

.form-row .form-group {
    margin-bottom: 0;
    flex: 1;
}

.dynamic-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.btn-remove-dynamic,
.btn-remove-proyecto {
    padding: 0.4rem 0.75rem;
    background: var(--admin-error);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-remove-dynamic:hover,
.btn-remove-proyecto:hover {
    background: #c82333;
}

.btn-add-dynamic {
    padding: 0.5rem 1rem;
    background: var(--admin-accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 1.5rem;
}

.btn-add-dynamic:hover {
    background: #3a8a6a;
}

.proyecto-block {
    border: 1px solid var(--admin-border);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    background: #fafafa;
}

.proyecto-block .form-group {
    margin-bottom: 1rem;
}

.proyecto-block .btn-remove-proyecto {
    margin-top: 0.5rem;
}

