/* ============================================
   APA GENERATOR - MAIN STYLES
   Estilos principales que usan el design system
   ============================================ */

/* Importar Design System (debe estar antes en el HTML) */

:root {
    --primary-color: #94335E;
    --secondary-color: #E5C99C;
    --sidebar-width: 260px;
}

/* ============================================
   BASE STYLES
   ============================================ */

body {
    background-color: #F9FAFB;
    padding-left: var(--sidebar-width);
    transition: padding-left 0.3s ease;
}

/* ============================================
   SIDEBAR MEJORADO
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, #94335E 0%, #6B2544 100%);
    border-right: 1px solid rgba(229, 201, 156, 0.2);
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1030;
    transition: left 0.3s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
}

.sidebar .sidebar-header {
    background: rgba(0, 0, 0, 0.1);
    color: #fff;
    padding: 2rem 1rem 1rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(229, 201, 156, 0.2);
}

.sidebar .profile-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #E5C99C;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.sidebar .profile-img:hover {
    transform: scale(1.05);
}

.sidebar .account-info {
    text-align: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.05);
    margin: 0 0.5rem;
    border-radius: 12px;
}

.sidebar .menu {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
}

.sidebar .menu li {
    margin: 0.25rem 0.5rem;
}

.sidebar .menu li a {
    display: block;
    padding: 0.875rem 1rem;
    color: #E5C99C;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 8px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.sidebar .menu li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(229, 201, 156, 0.1);
    transition: left 0.3s ease;
}

.sidebar .menu li a:hover::before,
.sidebar .menu li a.active::before {
    left: 0;
}

.sidebar .menu li a:hover,
.sidebar .menu li a.active {
    background: rgba(229, 201, 156, 0.15);
    color: white;
    transform: translateX(4px);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem 1rem;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* ============================================
   NAVBAR & BUTTONS
   ============================================ */

.navbar,
.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--secondary-color) !important;
}

.btn-primary {
    color: #fff !important;
    background: linear-gradient(135deg, #94335E 0%, #6B2544 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(148, 51, 94, 0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(148, 51, 94, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ============================================
   HEADINGS
   ============================================ */

h1,
h2 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* ============================================
   TABS
   ============================================ */

.nav-tabs .nav-link {
    color: var(--primary-color);
    font-weight: 500;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    transition: all 0.2s ease;
    padding: 0.75rem 1.5rem;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-link:hover {
    color: white;
    background: var(--primary-color);
    border-radius: 0.5rem 0.5rem 0 0;
    border-bottom: 2px solid var(--primary-color);
}

/* ============================================
   FORMS
   ============================================ */

.form-label {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(148, 51, 94, 0.15);
}

.tab-pane {
    background: linear-gradient(135deg, #94335E 0%, #7a2a53 100%);
    border-radius: 0.5rem;
    padding: 2rem 1rem 1rem 1rem;
    box-shadow: 0 4px 12px rgba(148, 51, 94, 0.15);
    margin-bottom: 2rem;
}

/* ============================================
   ALERTS
   ============================================ */

.alert-secondary {
    background: #FFF9F0;
    border: 1px solid #E5C99C;
    border-left: 4px solid var(--primary-color);
    color: #333;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

/* ============================================
   CITATIONS CONTAINER - MEJORADO
   ============================================ */

.citations-container {
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 1px solid #E5E7EB;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.citation-format {
    background: white;
    border-radius: 10px;
    padding: 1.25rem;
    border-left: 4px solid #94335E;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.citation-format:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border-left-width: 6px;
}

.citation-style-title {
    color: #94335E;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.citation-style-title::before {
    content: '';
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #94335E 0%, #6B2544 100%);
    border-radius: 50%;
    display: inline-block;
}

.citation-text {
    color: #374151;
    line-height: 1.7;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    font-family: 'Times New Roman', serif;
}

.copy-btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 2px solid #94335E;
    background: white;
    color: #94335E;
    font-weight: 500;
}

.copy-btn:hover {
    background-color: #94335E;
    border-color: #94335E;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(148, 51, 94, 0.3);
}

.copy-btn i {
    margin-right: 0.375rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Mobile Small (320px - 480px) */
@media (max-width: 480px) {
    .citations-container {
        padding: 1rem;
    }

    .citation-format {
        padding: 1rem;
    }

    .citation-text {
        font-size: 0.875rem;
    }

    .copy-btn {
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* Mobile & Tablet (max-width: 1000px) */
@media (max-width: 1000px) {
    body {
        padding-left: 0 !important;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -260px !important;
        height: 100vh !important;
        width: 260px !important;
        z-index: 1050 !important;
        background: linear-gradient(180deg, #94335E 0%, #6B2544 100%);
        transition: left 0.3s ease-in-out !important;
        overflow-y: auto !important;
        border-right: 1px solid rgba(229, 201, 156, 0.2);
    }

    .sidebar.active {
        left: 0 !important;
        box-shadow: 2px 0 16px rgba(0, 0, 0, 0.2) !important;
    }

    #sidebarToggle {
        display: block !important;
        position: fixed !important;
        top: 20px !important;
        left: 20px !important;
        z-index: 1051 !important;
        background: linear-gradient(135deg, #94335E 0%, #6B2544 100%) !important;
        border: 2px solid #E5C99C !important;
        color: white !important;
        padding: 12px !important;
        border-radius: 12px !important;
        font-size: 20px !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        opacity: 0.9 !important;
        box-shadow: 0 4px 12px rgba(148, 51, 94, 0.3);
    }

    #sidebarToggle:hover {
        opacity: 1 !important;
        transform: scale(1.05) !important;
        box-shadow: 0 6px 16px rgba(148, 51, 94, 0.4);
    }

    .main-content,
    .container {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .tab-pane {
        padding: 1.5rem 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}

/* Desktop (min-width: 1001px) */
@media (min-width: 1001px) {
    #sidebarToggle {
        display: none !important;
    }

    .sidebar {
        left: 0 !important;
    }
}

/* Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 1.5rem 2rem;
    }
}

/* Desktop Large (1200px+) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .citations-container {
        padding: 2rem;
    }
}