/**
 * Estilos Base del Admin
 * Layout principal y estructura
 *
 * @package BravesChat
 * @version 1.2.0
 */

/* ==================== RESET Y BASE ==================== */
.braves-admin-wrap * {
    box-sizing: border-box;
}

.braves-admin-wrap {
    margin: 20px 20px 0 0;
    font-family: var(--braves-font-sans);
    color: var(--braves-text-primary);
    line-height: var(--braves-leading-normal);
}

/* ==================== CONTAINER PRINCIPAL ==================== */
.braves-admin-container {
    max-width: var(--braves-container-max-width);
    margin: 0 auto;
    padding: 0;
}

/* ==================== HEADER ==================== */
.braves-admin-header {
    background: var(--braves-surface);
    border: 1px solid var(--braves-border-color);
    border-radius: var(--braves-radius-lg);
    padding: var(--braves-space-lg) var(--braves-space-xl);
    margin-bottom: var(--braves-space-xl);
    box-shadow: var(--braves-shadow-sm);
}

.braves-admin-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.braves-admin-header__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.braves-admin-header__logo svg,
.braves-admin-header__logo img {
    height: 52px;
    width: auto;
}

.braves-admin-header__logo-text {
    font-size: var(--braves-text-2xl);
    font-weight: var(--braves-font-bold);
    color: var(--braves-primary);
}

.braves-admin-header__notices {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--braves-space-xl);
}

.braves-admin-header__notices .braves-notice {
    margin: 0;
    width: 100%;
    max-width: 560px;
    padding: var(--braves-space-sm) var(--braves-space-lg);
    background: transparent;
    box-shadow: none;
}

.braves-admin-header__notices .braves-notice__content {
    font-size: var(--braves-text-lg);
    font-weight: 700;
}

.braves-admin-header__notices .braves-notice--warning .braves-notice__content {
    color: var(--braves-warning);
}

.braves-admin-header__notices .braves-notice--success .braves-notice__content {
    color: var(--braves-success);
}

.braves-admin-header__notices .braves-notice--info .braves-notice__content {
    color: var(--braves-info);
}

.braves-admin-header__notices .braves-notice--error .braves-notice__content {
    color: var(--braves-error);
}

.braves-admin-header__version {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--braves-space-xs);
    flex-shrink: 0;
}

.braves-admin-header__version-badge {
    display: flex;
    align-items: center;
    gap: var(--braves-space-sm);
}

.braves-header__mode-label {
    font-size: 11px;
    font-style: italic;
    color: var(--braves-gray-400);
    font-weight: 400;
    letter-spacing: 0.01em;
    opacity: 0.8;
}

[data-braves-theme="dark"] .braves-header__mode-label {
    color: var(--braves-gray-600);
}

/* ==================== BODY LAYOUT ==================== */
.braves-admin-body {
    display: flex;
    gap: var(--braves-space-xl);
    align-items: flex-start;
}

/* ==================== SIDEBAR ==================== */
.braves-admin-sidebar-col {
    flex-shrink: 0;
    width: var(--braves-sidebar-width);
    display: flex;
    flex-direction: column;
    gap: var(--braves-space-md);
    position: sticky;
    top: calc(32px + 25px);
    align-self: flex-start;
}

.braves-admin-sidebar {
    background: var(--braves-surface);
    border: 1px solid var(--braves-border-color);
    border-radius: var(--braves-radius-lg);
    padding: var(--braves-space-md);
    box-shadow: var(--braves-shadow-sm);
}

.braves-sidebar-save {
    width: 100%;
}

.braves-sidebar-save__btn {
    width: 100%;
    justify-content: center;
    border-radius: var(--braves-radius-md) !important;
    font-family: var(--braves-font-sans) !important;
    font-size: var(--braves-text-base) !important;
    font-weight: var(--braves-font-semibold) !important;
    padding: 10px 0 !important;
    height: auto !important;
    background-color: var(--braves-primary) !important;
    border-color: var(--braves-primary) !important;
    transition: background-color var(--braves-transition-fast), box-shadow var(--braves-transition-fast) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 119, 182, 0.2) !important;
}

.braves-sidebar-save__btn:hover,
.braves-sidebar-save__btn:focus {
    background-color: var(--braves-primary-hover) !important;
    border-color: var(--braves-primary-hover) !important;
}

[data-braves-theme="dark"] .braves-sidebar-save__btn {
    box-shadow: 0 4px 12px rgba(1, 183, 175, 0.25) !important;
    color: var(--braves-text-on-primary) !important;
}

[data-braves-theme="dark"] .braves-admin-header {
    background: var(--braves-surface);
    border-color: rgba(255, 255, 255, 0.07);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-braves-theme="dark"] .braves-admin-sidebar {
    background: var(--braves-surface);
    border-color: rgba(255, 255, 255, 0.07);
}

.braves-admin-sidebar__inner {
    display: flex;
    flex-direction: column;
    gap: var(--braves-space-sm);
}

.braves-admin-sidebar__item {
    display: flex;
    align-items: center;
    gap: var(--braves-space-md);
    padding: var(--braves-space-md);
    color: var(--braves-text-secondary);
    text-decoration: none;
    border-radius: var(--braves-radius-md);
    font-size: var(--braves-text-base);
    font-weight: var(--braves-font-medium);
    transition: all var(--braves-transition-fast);
    border: 1px solid transparent;
}

.braves-admin-sidebar__item:hover,
.braves-admin-sidebar__item:focus {
    background: var(--braves-surface-alt);
    color: var(--braves-primary);
    border-color: var(--braves-border-color);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
    outline: none;
}

.braves-admin-sidebar__item--active {
    color: var(--braves-primary);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
}

[data-braves-theme="dark"] .braves-admin-sidebar__item--active {
    background: var(--braves-surface-alt);
    color: var(--braves-primary-light);
    border-color: rgba(255, 255, 255, 0.13);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 6px 20px rgba(0, 0, 0, 0.65);
    transform: translateY(-2px);
}

[data-braves-theme="dark"] .braves-admin-sidebar__item:hover,
[data-braves-theme="dark"] .braves-admin-sidebar__item:focus {
    background: var(--braves-surface-alt);
    color: var(--braves-primary-light);
    border-color: rgba(255, 255, 255, 0.13);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 6px 20px rgba(0, 0, 0, 0.65);
    transform: translateY(-2px);
    outline: none;
}

.braves-admin-sidebar__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.braves-admin-sidebar__icon svg {
    width: 24px;
    height: 24px;
}

.braves-admin-sidebar__label {
    flex: 1;
}

/* ==================== CONTENT AREA ==================== */
.braves-admin-content {
    flex: 1;
    min-width: 0;
    padding-bottom: calc(var(--braves-space-3xl) * 2);
}

/* ==================== PAGE HEADER ==================== */
.braves-page-header {
    margin-bottom: var(--braves-space-2xl);
}

.braves-page-title {
    font-size: var(--braves-text-3xl);
    font-weight: var(--braves-font-bold);
    color: var(--braves-text-primary);
    margin: 0 0 var(--braves-space-sm) 0;
    line-height: var(--braves-leading-tight);
}

.braves-page-description {
    font-size: var(--braves-text-base);
    color: var(--braves-text-secondary);
    margin: 0;
    line-height: var(--braves-leading-relaxed);
}

/* ==================== SECCIONES ==================== */
.braves-section {
    margin-bottom: var(--braves-space-2xl);
}

.braves-section__title {
    font-size: var(--braves-text-xl);
    font-weight: var(--braves-font-semibold);
    color: var(--braves-text-primary);
    margin: 0 0 var(--braves-space-lg) 0;
}

.braves-section__description {
    font-size: var(--braves-text-sm);
    color: var(--braves-text-secondary);
    margin: 0 0 var(--braves-space-md) 0;
}

.braves-section--actions {
    padding: var(--braves-space-xl);
    background: var(--braves-surface);
    border: 1px solid var(--braves-border-color);
    border-radius: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.braves-section--warning {
    margin-bottom: var(--braves-space-xl);
}

.braves-section--info {
    margin-top: var(--braves-space-2xl);
}

/* ==================== RESPONSIVE ==================== */
@media screen and (max-width: 1024px) {
    .braves-admin-body {
        flex-direction: column;
    }

    .braves-admin-sidebar-col {
        width: 100%;
        position: static;
    }

    .braves-admin-sidebar__inner {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .braves-admin-sidebar__item {
        flex: 1;
        min-width: 150px;
        justify-content: center;
    }
}

@media screen and (max-width: 782px) {
    .braves-admin-wrap {
        margin: 10px 10px 0 0;
    }

    .braves-admin-header {
        padding: var(--braves-space-md) var(--braves-space-lg);
    }

    .braves-admin-header__logo svg,
    .braves-admin-header__logo img {
        height: 42px;
    }

    .braves-page-title {
        font-size: var(--braves-text-2xl);
    }

    .braves-admin-sidebar__item {
        font-size: var(--braves-text-sm);
        padding: var(--braves-space-sm) var(--braves-space-md);
    }
}

.braves-admin-header__verse {
    margin: 0;
    text-align: right;
    font-size: 11px;
    font-style: italic;
    color: var(--braves-primary);
    font-weight: 400;
    letter-spacing: 0.01em;
    opacity: 0.8;
    line-height: 1.4;
}

/* ==================== DARK MODE: LOGO SWAP ==================== */
/* Logo light (por defecto visible, dark oculto) */
.braves-admin-header__logo .logo-light { display: block; }
.braves-admin-header__logo .logo-dark  { display: none; }

[data-braves-theme="dark"] .braves-admin-header__logo .logo-light { display: none; }
[data-braves-theme="dark"] .braves-admin-header__logo .logo-dark  { display: block; }