/**
 * PTS Print Order - User Guide Custom Styles
 * Colors based on PresTeamShop brand
 */

/* ===================== CSS Variables ===================== */
:root {
    /* Brand Colors */
    --pts-primary: #25A7C3;
    --pts-primary-dark: #1E8DA6;
    --pts-primary-light: #3DBDD9;
    --pts-secondary: #E91E8C;
    --pts-secondary-dark: #C4177A;

    /* Neutral Colors */
    --pts-dark: #2D3748;
    --pts-gray: #4A5568;
    --pts-gray-light: #A0AEC0;
    --pts-bg-light: #F7FAFC;
    --pts-white: #FFFFFF;

    /* Semantic Colors */
    --pts-success: #38A169;
    --pts-warning: #DD6B20;
    --pts-danger: #E53E3E;
    --pts-info: #3182CE;

    /* Sidebar */
    --sidebar-width: 280px;
    --sidebar-bg: #F8FAFC;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ===================== Base Styles ===================== */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-family);
    color: var(--pts-dark);
    background-color: var(--pts-white);
    line-height: 1.7;
}

/* Override Bootstrap primary color */
.text-primary {
    color: var(--pts-primary) !important;
}

.bg-primary:not(.bg-opacity-10) {
    background-color: var(--pts-primary) !important;
}

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

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--pts-primary-dark);
    border-color: var(--pts-primary-dark);
}

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

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

.border-primary {
    border-color: var(--pts-primary) !important;
}

/* ===================== Header / Navbar ===================== */
header.navbar {
    z-index: 1030;
    padding: 0.75rem 0;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95) !important;
}

.navbar-brand {
    font-size: 1.1rem;
}

.logo-icon svg {
    transition: transform 0.2s ease;
}

.navbar-brand:hover .logo-icon svg {
    transform: scale(1.05);
}

/* Language Dropdown */
#languageDropdown {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* ===================== Sidebar ===================== */
.sidebar {
    background-color: var(--sidebar-bg);
    border-right: 1px solid #E2E8F0;
    min-height: calc(100vh - 60px);
}

.sidebar-nav {
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-bottom: 2rem;
}

/* Custom Scrollbar for Sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background-color: var(--pts-gray-light);
    border-radius: 4px;
}

.sidebar-nav .nav-link {
    color: var(--pts-gray);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.sidebar-nav .nav-link:hover {
    color: var(--pts-primary);
    background-color: rgba(37, 167, 195, 0.08);
}

.sidebar-nav .nav-link.active {
    color: var(--pts-primary);
    background-color: rgba(37, 167, 195, 0.12);
    font-weight: 500;
}

.sidebar-nav .nav-link i {
    font-size: 1rem;
    opacity: 0.8;
}

/* Nested Navigation */
.sidebar-nav .nav .nav {
    margin-top: 0.25rem;
}

.sidebar-nav .nav .nav .nav-link {
    font-size: 0.825rem;
    padding: 0.35rem 0.75rem;
    color: var(--pts-gray-light);
}

.sidebar-nav .nav .nav .nav-link:hover,
.sidebar-nav .nav .nav .nav-link.active {
    color: var(--pts-primary);
    background-color: transparent;
}

/* ===================== Main Content ===================== */
.main-content {
    min-height: calc(100vh - 60px);
}

/* Content Sections */
.content-section {
    padding-bottom: 3rem;
    margin-bottom: 1rem;
}

/* Reading width: limita el texto corrido (parrafos y listas) para mejor
   legibilidad en monitores anchos. NO afecta a tablas, tarjetas, alertas ni
   figuras, que siguen usando todo el ancho disponible. */
.content-section p,
.content-section > ul,
.content-section > ol,
.content-section article > ul,
.content-section article > ol {
    max-width: 78ch;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: var(--pts-dark);
}

h1.display-5 {
    color: var(--pts-primary);
}

h2.h2 {
    color: var(--pts-dark);
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.875rem;
    background: transparent;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--pts-primary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--pts-gray);
}

/* ===================== Cards ===================== */
.card {
    border-radius: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.card.shadow-sm:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

.card-header.bg-primary {
    background-color: var(--pts-primary) !important;
}

/* Feature Cards */
.feature-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.feature-icon i {
    line-height: 1;
}

/* ===================== Figure Images ===================== */
.figure-img {
    border: 1px solid #E2E8F0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* ===================== Placeholder Images ===================== */
.placeholder-image {
    background: linear-gradient(135deg, #F7FAFC 0%, #EDF2F7 100%);
    border: 2px dashed #CBD5E0 !important;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.placeholder-image:hover {
    border-color: var(--pts-primary) !important;
    background: linear-gradient(135deg, #EBF8FF 0%, #E6FFFA 100%);
}

.placeholder-image i {
    color: var(--pts-gray-light);
}

/* ===================== Steps ===================== */
.steps-container {
    position: relative;
}

.step {
    position: relative;
}

.step-number {
    font-size: 0.875rem;
    font-weight: 600;
    background-color: var(--pts-primary) !important;
}

/* ===================== Alerts ===================== */
.alert {
    border-radius: 0.5rem;
    border: none;
}

.alert-info {
    background-color: #EBF8FF;
    color: #2B6CB0;
}

.alert-warning {
    background-color: #FFFAF0;
    color: #C05621;
}

.alert-success {
    background-color: #F0FFF4;
    color: #276749;
}

.alert-danger {
    background-color: #FFF5F5;
    color: #C53030;
}

.alert-secondary {
    background-color: #F7FAFC;
    color: var(--pts-gray);
}

/* ===================== Accordion ===================== */
.accordion-button {
    font-weight: 500;
    color: var(--pts-dark);
}

.accordion-button:not(.collapsed) {
    background-color: rgba(37, 167, 195, 0.08);
    color: var(--pts-primary);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(37, 167, 195, 0.25);
    border-color: var(--pts-primary);
}

/* ===================== Tables ===================== */
.table {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table thead.table-light th {
    background-color: var(--pts-bg-light);
    border-bottom: 2px solid var(--pts-primary);
    font-weight: 600;
    color: var(--pts-dark);
}

/* ===================== Back to Top Button ===================== */
.btn-floating {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(37, 167, 195, 0.4);
}

.btn-floating.show {
    opacity: 1;
    visibility: visible;
}

.btn-floating:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(37, 167, 195, 0.5);
}

/* ===================== Footer ===================== */
footer {
    background-color: var(--pts-bg-light);
}

footer a {
    color: var(--pts-primary);
}

footer a:hover {
    color: var(--pts-primary-dark);
}

footer .bi {
    transition: transform 0.2s ease;
}

footer a:hover .bi {
    transform: scale(1.2);
}

/* ===================== Offcanvas (Mobile Sidebar) ===================== */
.offcanvas {
    max-width: 280px;
}

.offcanvas-header {
    background-color: var(--pts-bg-light);
}

/* ===================== List Groups ===================== */
.list-group-numbered > .list-group-item::before {
    color: var(--pts-primary);
    font-weight: 600;
}

/* ===================== Links ===================== */
a {
    color: var(--pts-primary);
}

a:hover {
    color: var(--pts-primary-dark);
}

/* ===================== Utility Classes ===================== */
.bg-opacity-10 {
    --bs-bg-opacity: 0.1;
}

/* ===================== Responsive Adjustments ===================== */

/* Large screens */
@media (min-width: 992px) {
    .main-content {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Tablet */
@media (max-width: 991.98px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0 !important;
    }

    h1.display-5 {
        font-size: 2rem;
    }
}

/* Mobile */
@media (max-width: 767.98px) {
    html {
        scroll-padding-top: 70px;
    }

    .content-section {
        padding-bottom: 2rem;
    }

    h1.display-5 {
        font-size: 1.75rem;
    }

    h2.h2 {
        font-size: 1.5rem;
    }

    h3.h4 {
        font-size: 1.15rem;
    }

    .card-body {
        padding: 1rem;
    }

    .btn-floating {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 44px;
        height: 44px;
    }

    .step-number {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.75rem;
    }

    .feature-icon {
        width: 48px;
        height: 48px;
    }

    .placeholder-image {
        height: 200px !important;
    }
}

/* Small Mobile */
@media (max-width: 575.98px) {
    .navbar-brand span:last-child {
        font-size: 0.95rem;
    }

    .row.g-4 > .col-md-6 {
        margin-bottom: 1rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }
}

/* ===================== Print Styles ===================== */
@media print {
    .sidebar,
    .btn-floating,
    header.navbar,
    .offcanvas {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .content-section {
        break-inside: avoid;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* ===================== Focus States (Accessibility) ===================== */
:focus-visible {
    outline: 2px solid var(--pts-primary);
    outline-offset: 2px;
}

.btn:focus-visible,
.nav-link:focus-visible,
.accordion-button:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(37, 167, 195, 0.35);
}

/* ===================== Selection Color ===================== */
::selection {
    background-color: var(--pts-primary);
    color: white;
}

/* ===================== Smooth Transitions ===================== */
.nav-link,
.btn,
.card,
.accordion-button,
a {
    transition: all 0.2s ease;
}
