﻿/* ===== ESTILOS BASE GLOBALES ===== */
/* Archivo: css/base.css */
/* Contiene: Variables CSS, reset, temas, estilos base compartidos */


*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* Lenis overrides native scroll — disable browser smooth-scroll to avoid conflicts */
    scroll-behavior: auto !important;
}

:root {
    --primary-color: #ff7b3a;
    --primary-hover: #ff6621;
    --primary-rgb: 255, 123, 58;
    --bg-dark: #1a1a1a;
    --bg-darker: #0f0f0f;
    --bg-primary: transparent;
    --bg-secondary: transparent;
    --bg-card: rgba(42, 42, 42, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #3a3a3a;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Courier New', monospace;
    background-color: var(--bg-darker);
    margin: 0;
    height: 100%;
    position: relative;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Theme Background Patterns */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

/* Dark Theme (Default) */
body {
    background-color: #121212;
    background-image: radial-gradient(
        circle at 50% 50%,
        rgba(255, 255, 255, 0.05) 1px,
        transparent 0
      ),
      linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0),
      linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 0);
    background-size:
      40px 40px,
      20px 20px,
      20px 20px;
}

body::before {
    background: repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(255, 255, 255, 0.03) 10px,
      rgba(255, 255, 255, 0.03) 20px
    );
    opacity: 0.8;
}

body::after {
    background: radial-gradient(
      circle,
      rgba(255, 255, 255, 0.07) 1px,
      transparent 1px
    );
    background-size: 60px 60px;
    opacity: 0.6;
}

/* Light Theme */
body.light-theme,
html.light-theme body {
    background-color: #f4f4f4;
    background-image: radial-gradient(
        circle at 50% 50%,
        rgba(0, 0, 0, 0.05) 1px,
        transparent 0
      ),
      linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 0),
      linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 0);
    background-size:
      40px 40px,
      20px 20px,
      20px 20px;
}

body.light-theme::before,
html.light-theme body::before {
    background: repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(0, 0, 0, 0.03) 10px,
      rgba(0, 0, 0, 0.03) 20px
    );
    opacity: 0.8;
}

body.light-theme::after,
html.light-theme body::after {
    background: radial-gradient(
      circle,
      rgba(0, 0, 0, 0.07) 1px,
      transparent 1px
    );
    background-size: 60px 60px;
    opacity: 0.6;
}

/* Aplicar tema desde localStorage */
body.light-theme,
html.light-theme body {
    --bg-dark: #ffffff;
    --bg-darker: #f8f8f8;
    --bg-primary: transparent;
    --bg-secondary: transparent;
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ===== COMPONENTES REUTILIZABLES ===== */

/* Tipografía Tech/Gaming para títulos y elementos importantes */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Welcome Section - Compartido entre páginas */
.welcome-section {
    text-align: center;
    padding: 4rem 2rem;
    background: transparent;
    margin-bottom: 3rem;
}

.welcome-title {
    font-size: 3rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.welcome-text {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    line-height: 1.4;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 500;
}

/* Botones base */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: var(--transition-normal);
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: scale(1.02);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Utilidades */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--primary-color); }

/* ===== FOOTER ===== */
.footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.footer-logo i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.footer-center {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.copyright, .footer-author {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.footer-author strong {
    color: var(--primary-color);
}

.footer-right {
    text-align: right;
}

.footer-seal {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-seal i {
    color: var(--primary-color);
}

/* ===== BOTÓN SCROLL TO TOP ===== */
#scrollTopBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    background: #ffffff;
    color: #000000;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    z-index: 999;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

#scrollTopBtn:hover {
    background: #f0f0f0;
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

#scrollTopBtn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Footer Responsive */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }

    .footer-right {
        text-align: center;
    }

    .footer-seal {
        justify-content: center;
    }
}

/* ===== ICONOS PNG DE COMPONENTES ===== */
.category-icon-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: invert(1) brightness(0.85);
    transition: filter 0.35s ease, transform 0.35s ease;
    display: block;
}

/* ===== SISTEMA DE NOTIFICACIONES TOAST (PCNotify) ===== */
#pcnotify-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    pointer-events: none;
    max-width: 380px;
    width: calc(100% - 3rem);
}

.pcnotify-toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.88rem 1.1rem 1.1rem;
    border-radius: 10px;
    border-left: 4px solid transparent;
    background: rgba(22, 22, 22, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    pointer-events: all;
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
    transition: transform 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.35s ease;
    will-change: transform, opacity;
    font-family: 'Courier New', monospace;
    font-size: 0.93rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: #f0f0f0;
    cursor: pointer;
    overflow: hidden;
}

.pcnotify-toast.pcn-show {
    transform: translateX(0);
    opacity: 1;
}

.pcnotify-toast.pcn-hide {
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
    transition: transform 0.32s ease-in, opacity 0.3s ease;
}

.pcnotify-toast.pcn-success { border-left-color: #22c55e; }
.pcnotify-toast.pcn-warning { border-left-color: #f59e0b; }
.pcnotify-toast.pcn-error   { border-left-color: #ef4444; }
.pcnotify-toast.pcn-info    { border-left-color: #3b82f6; }

.pcnotify-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.08rem;
    line-height: 1;
}

.pcnotify-toast.pcn-success .pcnotify-icon { color: #22c55e; }
.pcnotify-toast.pcn-warning .pcnotify-icon { color: #f59e0b; }
.pcnotify-toast.pcn-error   .pcnotify-icon { color: #ef4444; }
.pcnotify-toast.pcn-info    .pcnotify-icon { color: #3b82f6; }

.pcnotify-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.pcnotify-title {
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.pcnotify-toast.pcn-success .pcnotify-title { color: #22c55e; }
.pcnotify-toast.pcn-warning .pcnotify-title { color: #f59e0b; }
.pcnotify-toast.pcn-error   .pcnotify-title { color: #ef4444; }
.pcnotify-toast.pcn-info    .pcnotify-title { color: #3b82f6; }

.pcnotify-msg {
    line-height: 1.42;
    color: #e8e8e8;
}

.pcnotify-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: left center;
    transform: scaleX(1);
}

.pcnotify-toast.pcn-success .pcnotify-progress { background: #22c55e; }
.pcnotify-toast.pcn-warning .pcnotify-progress { background: #f59e0b; }
.pcnotify-toast.pcn-error   .pcnotify-progress { background: #ef4444; }
.pcnotify-toast.pcn-info    .pcnotify-progress { background: #3b82f6; }

/* ===== Confirm dialog ===== */
.pcnotify-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(4px);
}

.pcnotify-overlay.pcn-show {
    opacity: 1;
}

.pcnotify-dialog {
    background: rgb(30, 30, 30);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 28px 32px 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.92) translateY(10px);
    transition: transform 0.25s ease;
}

.pcnotify-overlay.pcn-show .pcnotify-dialog {
    transform: scale(1) translateY(0);
}

.pcnotify-dialog-icon {
    font-size: 2.2rem;
    color: var(--primary-color, #ff6b35);
    margin-bottom: 12px;
}

.pcnotify-dialog-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.pcnotify-dialog-msg {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    margin-bottom: 22px;
}

.pcnotify-dialog-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.pcnotify-btn {
    padding: 9px 24px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.pcnotify-btn-cancel {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pcnotify-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.pcnotify-btn-accept {
    background: var(--primary-color, #ff6b35);
    color: #fff;
}

.pcnotify-btn-accept:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

/* Light theme confirm dialog */
.light-theme .pcnotify-dialog,
html.light-theme .pcnotify-dialog {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.light-theme .pcnotify-dialog-title,
html.light-theme .pcnotify-dialog-title {
    color: #1a1a1a;
}

.light-theme .pcnotify-dialog-msg,
html.light-theme .pcnotify-dialog-msg {
    color: rgba(0, 0, 0, 0.55);
}

.light-theme .pcnotify-btn-cancel,
html.light-theme .pcnotify-btn-cancel {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.6);
    border-color: rgba(0, 0, 0, 0.1);
}

.light-theme .pcnotify-btn-cancel:hover,
html.light-theme .pcnotify-btn-cancel:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

/* Light theme adaptations */
.light-theme .pcnotify-toast,
html.light-theme .pcnotify-toast {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.07);
    color: #1a1a1a;
}

.light-theme .pcnotify-msg,
html.light-theme .pcnotify-msg {
    color: #333;
}

.category-card:hover .category-icon-img {
    filter: invert(0.85) sepia(1) hue-rotate(330deg) saturate(3) brightness(1.1);
    transform: translateY(-2px) scale(1.05);
}

html.light-theme .category-icon-img,
body.light-theme .category-icon-img {
    filter: invert(0) brightness(0.3);
}

html.light-theme .category-card:hover .category-icon-img,
body.light-theme .category-card:hover .category-icon-img {
    filter: invert(0) brightness(0) sepia(1) hue-rotate(330deg) saturate(3);
}

/* Configurador component grid */
.component-icon-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: invert(1) brightness(0.8);
    transition: filter 0.3s ease;
    margin: 0 auto 0.75rem;
    display: block;
}

html.light-theme .component-icon-img,
body.light-theme .component-icon-img {
    filter: invert(0) brightness(0.35);
}

/* Index page component-apple section */
.component-apple-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    filter: invert(1) brightness(0.85);
    transition: filter 0.3s ease, transform 0.3s ease;
    margin: 0 auto 0.6rem;
    display: block;
}

.component-apple:hover .component-apple-img {
    filter: invert(0.85) sepia(1) hue-rotate(330deg) saturate(3) brightness(1.1);
    transform: scale(1.08);
}

html.light-theme .component-apple-img,
body.light-theme .component-apple-img {
    filter: invert(0) brightness(0.3);
}
