﻿/* CLAUDE PERRO LARGO CSS - LEGENDARY COMPLETE STYLES
   Named after Claude AI who helped create this masterpiece! 🐕 
   Combined layout and branding styles for optimal performance 
   Version: 28 from Claude - HEADER ALIGNMENT FIXED
*/

/* ========================================
   BRAND COLOR VARIABLES & THEMES
   ======================================== */

:root[data-theme="light"] {
    --pl-black: #000000;
    --pl-green: #3FAE2A;
    --pl-blue: #007CBA;
    --pl-red: #FF3E3E;
    --pl-yellow: #FCC715;
    --pl-bg: #ffffff;
    --pl-text: #000000;
    --pl-text-muted: #666666;
    --pl-border: #cccccc;
    --pl-hover-bg: #f8f9fa;
    --pl-link: #007CBA;
    --pl-link-hover: #005a8a;
}

:root[data-theme="dark"] {
    --pl-black: #ffffff;
    --pl-green: #3FAE2A;
    --pl-blue: #007CBA;
    --pl-red: #FF3E3E;
    --pl-yellow: #FCC715;
    --pl-bg: #1a1a1a;
    --pl-text: #ffffff;
    --pl-text-muted: #b3b3b3;
    --pl-border: #404040;
    --pl-hover-bg: #2a2a2a;
    --pl-link: #007CBA;
    --pl-link-hover: #4ac3ff;
}

:root[data-theme="high-contrast"] {
    --pl-black: #000000;
    --pl-green: #3FAE2A;
    --pl-blue: #007CBA;
    --pl-red: #FF3E3E;
    --pl-yellow: #FCC715;
    --pl-bg: #ffffff;
    --pl-text: #000000;
    --pl-text-muted: #000000;
    --pl-border: #000000;
    --pl-hover-bg: #FCC715;
    --pl-link: #000000;
    --pl-link-hover: #FF3E3E;
}

:root[data-theme="colorblind"] {
    --pl-black: #000000;
    --pl-green: #007CBA;
    --pl-blue: #FF3E3E;
    --pl-red: #FCC715;
    --pl-yellow: #3FAE2A;
    --pl-bg: #ffffff;
    --pl-text: #000000;
    --pl-text-muted: #666666;
    --pl-border: #cccccc;
    --pl-hover-bg: #f8f9fa;
    --pl-link: #007CBA;
    --pl-link-hover: #005a8a;
}

/* ========================================
   GLOBAL RESET & BASE STYLES
   ======================================== */

* {
    box-sizing: border-box;
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--pl-bg);
    color: var(--pl-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ========================================
   HEADER STYLES - THE BEST HEADER ON EARTH! 🐕
   ======================================== */

.perro-largo-header {
    background: linear-gradient(135deg, var(--pl-bg) 0%, rgba(63, 174, 42, 0.05) 100%);
    border-bottom: 3px solid var(--pl-green);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-container {
    width: 100%; /* FIXED: Full width instead of max-width */
    margin: 0; /* FIXED: Remove auto centering */
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between; /* FIXED: Space between left and right sections */
    gap: 2rem;
}

/* BRAND SECTION */
.header-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: transform 0.2s ease;
}

    .brand-link:hover {
        transform: translateY(-1px);
    }

.brand-logo {
    height: 50px;
    width: auto;
    transition: filter 0.2s ease;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--pl-green);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.brand-tagline {
    font-size: 0.75rem;
    color: var(--pl-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* MOBILE HAMBURGER */
.mobile-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: var(--pl-green);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
    margin: 2px 0;
}

.mobile-hamburger:hover {
    background: var(--pl-blue);
    transform: scale(1.05);
}

.mobile-hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* DESKTOP NAVIGATION */
.desktop-nav {
    flex: 0 1 auto; /* FIXED: Don't take up extra space */
    display: flex;
    justify-content: flex-start; /* FIXED: Left align instead of center */
    margin-left: 2rem; /* FIXED: Space from brand section */
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
    align-items: center;
}

.nav-item {
    color: var(--pl-text);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
}

    .nav-item:hover {
        background: var(--pl-hover-bg);
        color: var(--pl-green);
        transform: translateY(-1px);
    }

    .nav-item.nav-cta {
        background: var(--pl-green);
        color: white;
        font-weight: 600;
    }

        .nav-item.nav-cta:hover {
            background: var(--pl-blue);
            color: white;
        }

/* DROPDOWN MENU */
.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: '▼';
    margin-left: 0.5rem;
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--pl-bg);
    border: 1px solid var(--pl-border);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1001;
}

.dropdown:hover .dropdown-menu,
.dropdown.show .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--pl-text);
    text-decoration: none;
    transition: background 0.2s ease;
}

    .dropdown-menu a:hover {
        background: var(--pl-green);
        color: white;
    }

/* HEADER ACTIONS */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* MINI LANGUAGE SWITCHER */
.mini-language {
    position: relative;
}

.language-select {
    background: var(--pl-bg);
    border: 1px solid var(--pl-border);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    color: var(--pl-text);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

    .language-select:hover {
        border-color: var(--pl-green);
        background: var(--pl-hover-bg);
    }

    .language-select:focus {
        outline: none;
        border-color: var(--pl-blue);
        box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
    }

/* MINI THEME TOGGLE */
.mini-theme-toggle {
    background: var(--pl-bg);
    border: 1px solid var(--pl-border);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

    .mini-theme-toggle:hover {
        background: var(--pl-green);
        border-color: var(--pl-green);
        transform: scale(1.1);
    }

        .mini-theme-toggle:hover .theme-icon {
            filter: invert(1);
        }

/* MOBILE SIDEBAR INTEGRATION */
.sidebar.mobile-open {
    transform: translateX(0);
}

body.sidebar-open {
    overflow: hidden;
}

    body.sidebar-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

/* HEADER RESPONSIVE BEHAVIOR */
@media (max-width: 1200px) {
    .header-container {
        gap: 1rem;
    }

    .desktop-nav {
        margin-left: 1rem;
    }

    .nav-menu {
        gap: 0.25rem;
    }

    .nav-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 992px) {
    .header-container {
        gap: 0.5rem;
    }

    .desktop-nav {
        margin-left: 0.5rem;
    }

    .nav-item {
        padding: 0.5rem 0.5rem;
        font-size: 0.85rem;
    }

    .header-actions {
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .mobile-hamburger {
        display: flex;
    }

    .desktop-nav,
    .header-actions {
        display: none;
    }

    .brand-text {
        display: none;
    }

    .header-container {
        gap: 1rem;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
}

@media (max-width: 480px) {
    .perro-largo-header {
        padding: 0.5rem 0;
    }

    .header-container {
        padding: 0 0.5rem;
    }

    .brand-logo {
        height: 40px;
    }
}

@media (min-width: 1200px) {
    .header-actions {
        gap: 1rem;
    }

    .nav-menu {
        gap: 1rem;
    }
}

/* THEME SPECIFIC ADJUSTMENTS */
[data-theme="dark"] .perro-largo-header {
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .dropdown-menu {
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

/* ========================================
   MAIN LAYOUT CONTAINER
   ======================================== */

.layout-container {
    display: flex;
    flex: 1;
    min-height: 0;
    margin: 0;
    padding: 0;
}

/* ========================================
   SIDEBAR STYLES
   ======================================== */

.sidebar {
    width: 250px;
    min-height: 100%;
    flex-shrink: 0;
    background-color: var(--pl-bg) !important;
    border-right: 1px solid var(--pl-border);
}

    .sidebar .nav-link {
        color: var(--pl-text) !important;
        padding: 0.5rem 1rem;
        text-decoration: none;
        display: flex;
        align-items: center;
        border-radius: 0.375rem;
        transition: all 0.15s ease-in-out;
    }

        .sidebar .nav-link:hover {
            background-color: var(--pl-hover-bg) !important;
            color: var(--pl-text) !important;
        }

.nav-link .toggle-icon {
    margin-right: 0.3rem;
}

    .nav-link .toggle-icon i {
        color: var(--pl-text-muted) !important;
    }

.sidebar .nav-link i.bi-folder,
.sidebar .nav-link i.bi-file-earmark-text {
    margin-right: 0.5rem;
    color: var(--pl-blue) !important;
}

.nav-link .folder-text {
    color: var(--pl-text) !important;
}

.sidebar .nav-link.active,
.sidebar .nav-link[aria-expanded="true"] {
    background-color: var(--pl-green) !important;
    color: white !important;
}

    .sidebar .nav-link.active i,
    .sidebar .nav-link[aria-expanded="true"] i {
        color: white !important;
    }

.collapse {
    transition: all 0.35s ease;
}

.sidebar .list-unstyled .nav-link {
    padding-left: 2rem;
    font-size: 0.9rem;
}

.sidebar .list-unstyled .list-unstyled .nav-link {
    padding-left: 3rem;
    font-size: 0.85rem;
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */

.main-content {
    flex: 1;
    padding: 10px 20px;
    overflow-y: auto;
}

    .main-content > * {
        margin-bottom: 0 !important;
    }

    .main-content p:last-child,
    .main-content div:last-child,
    .main-content h1:last-child,
    .main-content h2:last-child,
    .main-content h3:last-child {
        margin-bottom: 0 !important;
    }

main {
    flex: 1;
    padding: 0.5rem;
    margin: 0;
}

/* ========================================
   FOOTER STYLES - THE BEST FOOTER ON EARTH! 🐕
   ======================================== */

.perro-largo-footer {
    background: linear-gradient(135deg, var(--pl-bg) 0%, rgba(63, 174, 42, 0.02) 100%);
    border-top: 2px solid var(--pl-green);
    padding: 1rem 0;
    margin-top: 0;
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 100px;
}

    .perro-largo-footer::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, var(--pl-green) 0%, var(--pl-blue) 25%, var(--pl-red) 50%, var(--pl-yellow) 75%, var(--pl-green) 100%);
    }

.footer-container {
    width: 100%;
    padding: 0 1rem;
    margin: 0;
    height: 100%;
    position: relative;
}

.footer-content {
    display: grid !important;
    grid-template-columns: 1fr auto;
    grid-template-rows: 1fr;
    gap: 2rem !important;
    width: 100%;
    min-height: 90px;
    position: relative;
}

.footer-left {
    display: grid !important;
    gap: 0.75rem !important;
    align-content: start;
    justify-content: start;
    text-align: left !important;
    padding: 0.5rem 0;
}

.footer-right {
    display: grid !important;
    grid-template-rows: auto 1fr;
    gap: 0.5rem;
    min-width: 200px;
    height: 100%;
    position: relative;
}

.footer-top-right {
    justify-self: end;
    align-self: start;
    text-align: right;
    font-size: 0.7rem;
    color: var(--pl-text-muted);
    line-height: 1.3;
    font-family: 'Courier New', monospace;
}

.footer-bottom-right {
    justify-self: end;
    align-self: end;
    text-align: right;
    display: grid;
    gap: 0.05rem;
    justify-items: end;
    line-height: 1.1;
}

.copyright-main {
    font-weight: bold;
    color: var(--pl-text);
    font-size: 1.4rem;
    margin-bottom: 0;
    line-height: 1;
}

.company-type {
    font-style: italic;
    font-size: 0.75rem;
    color: var(--pl-text-muted);
    margin-top: 0;
    line-height: 1;
}

.footer-content > * {
    min-height: 0;
    min-width: 0;
}

.footer-right {
    position: relative;
}

.footer-top-right,
.footer-bottom-right {
    position: relative;
    z-index: 1;
}

/* ========================================
   LANGUAGE SECTION
   ======================================== */

.language-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.language-label {
    font-weight: 600;
    color: var(--pl-green);
}

.language-links {
    display: flex;
    gap: 0.25rem;
}

.lang-link {
    color: var(--pl-link);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
    border: 1px solid transparent;
}

    .lang-link:hover {
        background-color: var(--pl-hover-bg);
        border-color: var(--pl-green);
        transform: translateY(-1px);
    }

    .lang-link.active {
        background-color: var(--pl-green);
        color: white;
        font-weight: 600;
    }

/* ========================================
   THEME SECTION
   ======================================== */

.theme-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle {
    background: linear-gradient(45deg, var(--pl-blue), var(--pl-green));
    color: white;
    border: none;
    padding: 0.25rem .6rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .theme-toggle::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(45deg, var(--pl-yellow), var(--pl-red));
        transition: left 0.3s ease;
    }

    .theme-toggle:hover::before {
        left: 0;
    }

    .theme-toggle span {
        position: relative;
        z-index: 1;
    }

    .theme-toggle:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(63, 174, 42, 0.3);
    }

/* ========================================
   PAGE COUNTER & CULTURE INFO
   ======================================== */

.page-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--pl-text-muted);
}

.counter-number {
    background: var(--pl-yellow);
    color: var(--pl-red);
    padding: .1em 0.4em;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1.5em;
}

.culture-info {
    display: grid;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--pl-text-muted);
    font-family: 'Courier New', monospace;
}

/* ========================================
   FOCUS STYLES
   ======================================== */

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--pl-blue);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

@media (max-width: 767px) {
    .layout-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
    }

    .footer-content {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto !important;
        gap: 1.5rem !important;
    }

    .footer-right {
        grid-template-rows: auto auto !important;
        min-width: unset;
    }

    .footer-top-right,
    .footer-bottom-right {
        justify-self: start !important;
        text-align: left !important;
    }

    .footer-bottom-right {
        justify-items: start !important;
    }

    .language-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .language-links {
        flex-wrap: wrap;
    }

    .theme-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .footer-container {
        padding: 0 0.5rem;
    }

    .perro-largo-footer {
        padding: 1rem 0;
    }

    .footer-top-right {
        font-size: 0.6rem;
    }

    .copyright-main {
        font-size: 0.8rem;
    }

    .company-type {
        font-size: 0.7rem;
    }

    .language-links {
        width: 100%;
        justify-content: space-between;
    }

    .lang-link {
        flex: 1;
        text-align: center;
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }

    .culture-info {
        font-size: 0.7rem;
    }

    .page-counter {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* ========================================
   ACCESSIBILITY & PRINT STYLES
   ======================================== */

@media (prefers-contrast: high) {
    .perro-largo-header,
    .perro-largo-footer {
        border-top: 3px solid var(--pl-text);
        border-bottom: 3px solid var(--pl-text);
    }

    .lang-link {
        border: 2px solid var(--pl-text);
        margin: 0.125rem;
    }

    .theme-toggle,
    .mini-theme-toggle {
        border: 2px solid var(--pl-text);
    }
}

@media (prefers-reduced-motion: reduce) {
    .lang-link,
    .theme-toggle,
    .mini-theme-toggle,
    .collapse,
    .nav-item,
    .brand-link {
        transition: none;
    }

        .theme-toggle:hover,
        .mini-theme-toggle:hover,
        .nav-item:hover,
        .brand-link:hover {
            transform: none;
        }
}

@media print {
    .perro-largo-header,
    .perro-largo-footer {
        background: white !important;
        border-top: 2px solid #000000 !important;
        border-bottom: 2px solid #000000 !important;
        color: #000000 !important;
    }

    .theme-toggle,
    .mini-theme-toggle,
    .mobile-hamburger {
        display: none !important;
    }

    .lang-link {
        color: #000000 !important;
        text-decoration: underline !important;
    }

    .culture-info {
        display: none;
    }

    .footer-content {
        display: flex !important;
        flex-direction: row !important;
    }

    .sidebar {
        display: none !important;
    }

    .layout-container {
        display: block !important;
    }

    .desktop-nav {
        display: none !important;
    }
}

/* ========================================
   DEMO CONTENT (can be removed if not needed)
   ======================================== */

.demo-content {
    text-align: center;
}

    .demo-content h1 {
        color: var(--pl-green);
        margin-bottom: 1rem;
    }

.demo-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.demo-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--pl-blue);
    background: var(--pl-bg);
    color: var(--pl-blue);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .demo-btn:hover {
        background: var(--pl-blue);
        color: white;
    }