/* =============================================================================
   COPS - Tema Nodet.ar
   Diseño oscuro y moderno inspirado en el portal nodet.ar
   ========================================================================== */

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #05060b;
  --accent-gradient: linear-gradient(135deg, #5b8def, #7e5ce3, #4cd3c2);
  --card: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #e9ecf2;
  --muted: #9aa4b5;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --link-color: #9fd7ff;
  --hover-bg: rgba(255, 255, 255, 0.1);
}

/* Global Box Sizing and Font-Smoothing */
*, *:after, *:before {
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-font-smoothing: antialiased;
    -o-font-smoothing: antialiased;
    font-smoothing: antialiased;
}

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    color: var(--text);
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgba(91, 141, 239, 0.2), transparent 25%),
                radial-gradient(circle at 80% 0%, rgba(76, 211, 194, 0.16), transparent 22%),
                radial-gradient(circle at 60% 70%, rgba(126, 92, 227, 0.18), transparent 30%),
                var(--bg);
    overflow-x: hidden;
    position: relative;
}

/* Noise overlay effect */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    mix-blend-mode: soft-light;
    z-index: 0;
}

img {
    border: 0;
    max-width: 100%;
    height: auto;
    width: auto\9;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin: 0;
    padding: 0;
    letter-spacing: -0.02em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 0.95rem; }
h6 { font-size: 0.85rem; }

a {
    color: var(--link-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 160ms ease, transform 160ms ease;
}

a:hover, a:focus, a:active {
    outline: none;
    color: #cfe9ff;
    text-decoration: none;
}

.frontpage a {
    display: block;
    padding: 12px 16px;
    border-radius: 12px;
    transition: background 180ms ease, transform 180ms ease;
}

.frontpage a:hover {
    background-color: var(--hover-bg);
    transform: translateX(4px);
}

.books:hover {
    background-color: var(--hover-bg);
}

.link a:hover {
    display: inline-block;
    background-color: var(--hover-bg);
    zoom: 1;
    *display: inline;
}

/* Popup styles */
.mfp-content .bookpopup {
    position: relative;
    background: rgba(10, 12, 20, 0.98);
    backdrop-filter: blur(20px);
    padding: 28px;
    width: auto;
    max-width: 700px;
    margin: 20px auto;
    min-height: 198px;
    border-radius: 18px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    color: var(--text);
}

.mfp-content .bookpopup h2 {
    color: var(--text);
    margin-bottom: 12px;
}

.mfp-content .bookpopup p {
    color: var(--muted);
    line-height: 1.6;
}

#email {
    width: 300px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    color: var(--text);
    font-family: inherit;
}

#email:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

/* Filter styles */
.filtered {
    display: none;
}

#filter {
    clear: both;
    margin-top: 12px;
}

#filter ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
    text-align: left;
    text-transform: none;
}

#filter ul li {
    cursor: pointer;
}

li {
    display: inline-block;
    padding: 8px 14px;
    margin: 4px;
    color: var(--text);
    background-color: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    opacity: 0.7;
    transition: all 180ms ease;
}

li:hover {
    opacity: 1;
    background-color: var(--hover-bg);
}

.filter-include {
    border-left: 3px solid #5b8def;
    opacity: 1;
    background-color: rgba(91, 141, 239, 0.1);
}

.filter-include:after {
    content: " ✓";
}

.filter-exclude {
    border-right: 3px solid #ff6b6b;
    opacity: 1;
    background-color: rgba(255, 107, 107, 0.1);
}

.filter-exclude:after {
    content: " ✗";
}

/* Container */
.container {
    background: transparent;
    border: none;
    max-width: 1100px;
    width: 95%;
    margin: 0 auto;
    position: relative;
    padding: 48px 24px 64px;
    z-index: 1;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 32px;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(91, 141, 239, 0.08), rgba(126, 92, 227, 0.06));
    border-radius: 18px;
    opacity: 0;
    transition: opacity 200ms ease;
    pointer-events: none;
}

header:hover::after {
    opacity: 1;
}

/* Header icons */
.hicon {
    color: var(--text);
    text-shadow: none;
    transition: all 180ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hicon:hover {
    color: #9fd7ff;
    transform: scale(1.05);
}

.hicon64 {
    font-size: 28px !important;
    line-height: 28px !important;
    width: 28px !important;
    height: 28px !important;
}

.hicon32 {
    font-size: 20px !important;
    line-height: 20px !important;
    width: 20px !important;
    height: 20px !important;
}

.headleft {
    float: none;
    order: 1;
}

.headcenter {
    float: none;
    margin: 0;
    text-align: center;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    order: 2;
}

.headright {
    float: none;
    cursor: pointer;
    order: 3;
}

.submit {
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    background: var(--card);
    border: 1px solid var(--card-border);
    color: var(--text);
    padding: 8px 12px;
    cursor: pointer;
    transition: all 180ms ease;
}

.submit:hover {
    background: var(--hover-bg);
    border-color: rgba(255, 255, 255, 0.2);
}

header h1 {
    display: block;
    vertical-align: middle;
    text-align: center;
    line-height: 1.2;
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0;
    font-size: 1.5rem;
}

/* Logo style similar to nodet.ar */
header h1::first-letter {
    background-image: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Tool section (search form, filters) */
#tool {
    width: 100%;
    order: 4;
    margin-top: 12px;
}

#searchForm {
    display: flex;
    gap: 8px;
    align-items: center;
}

#searchForm > div {
    flex: 1;
}

#sortForm {
    margin-top: 12px;
}

.stop {
    flex: 1;
}

/* Search form */
#searchForm input[type="text"] {
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    color: var(--text);
    font-family: inherit;
    width: 100%;
}

#searchForm input[type="text"]:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
}

select {
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Download section in book detail */
.download {
    float: right;
    line-height: normal;
    text-align: right;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.download a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-weight: 600;
    border: 1px solid var(--card-border);
    transition: all 180ms ease;
    font-size: 0.9rem;
    text-decoration: none;
}

.download a:hover {
    transform: translateY(-1px);
    background: var(--hover-bg);
    border-color: rgba(255, 255, 255, 0.2);
    color: #9fd7ff;
}

.download a i {
    font-size: 16px;
    line-height: 1;
}

.download a .fa-download {
    color: #5b8def;
}

.download a .fa-folder-open {
    color: #7e5ce3;
}

.download a .fa-envelope {
    color: #4cd3c2;
}

.download a .fa-eye {
    color: #9fd7ff;
}

/* Footer */
footer {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    margin-top: 48px;
    color: var(--muted);
    text-align: center;
    padding: 20px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 20px;
}

.footleft {
    display: flex;
    align-items: center;
    height: auto;
    flex: 0 0 auto;
}

.footcenter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    height: auto;
    flex: 1;
}

.footcenter p {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.footcenter a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 200ms ease;
}

.footcenter .hicon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footcenter a:hover {
    transform: scale(1.1);
}

.footcenter a:hover i {
    color: var(--accent);
}

/* Footer responsive */
@media (max-width: 768px) {
    footer {
        flex-direction: column;
        gap: 16px;
    }
    
    .footleft {
        order: 2;
    }
    
    .footcenter {
        order: 1;
    }
}

/* Language Shortcuts Section - Home only */
.lang-shortcuts {
    margin: 32px 0 48px 0;
    padding: 0;
}

.lang-shortcuts-title {
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding: 0 4px;
    background: linear-gradient(135deg, #5b8def 0%, #7e5ce3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lang-shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.lang-shortcut-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    text-decoration: none;
    transition: all 200ms ease;
    position: relative;
    overflow: hidden;
}

.lang-shortcut-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(91, 141, 239, 0.12), rgba(126, 92, 227, 0.08));
    opacity: 0;
    transition: opacity 200ms ease;
    pointer-events: none;
}

.lang-shortcut-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: var(--shadow);
}

.lang-shortcut-card:hover::after {
    opacity: 1;
}

.lang-icon {
    font-size: 3rem;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.lang-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lang-name {
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.lang-count {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

/* Responsive para lang shortcuts */
@media (max-width: 768px) {
    .lang-shortcuts-grid {
        grid-template-columns: 1fr;
    }
    
    .lang-shortcut-card {
        padding: 16px;
    }
    
    .lang-icon {
        font-size: 2.5rem;
    }
}

/* Entry cards - similar to nodet.ar cards */
.entry {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: transform 200ms ease, border-color 200ms ease, background 200ms ease;
}

.entry::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(91, 141, 239, 0.12), rgba(126, 92, 227, 0.08));
    opacity: 0;
    transition: opacity 200ms ease;
    pointer-events: none;
}

.entry:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.18);
}

.entry:hover::after {
    opacity: 1;
}

.entry h2, .entry h3 {
    color: var(--text);
    margin-bottom: 8px;
}

.entry p {
    color: var(--muted);
    margin: 8px 0;
}

/* Books list */
.books {
    padding: 12px;
    border-radius: 16px;
    background: var(--card);
    border: 1px solid var(--card-border);
    transition: all 200ms ease;
    margin: 16px 0;
    clear: both;
    min-height: 90px;
    position: relative;
}

.books h2 {
    margin-bottom: 6px;
}

.books h4 {
    display: inline;
    font-style: normal;
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0;
}

.books .book-meta {
    margin: 4px 0;
    line-height: 1.6;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.books .meta-label {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.books .sa, .books .se, .books .ss {
    color: var(--text);
    font-size: 0.95rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Book covers - Lista principal */
.books .cover {
    float: left;
    width: 60px;
    height: 82px;
    margin: 4px 10px 4px 4px;
    position: absolute;
    flex: 0 0 60px;
    overflow: hidden;
}

.books .cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: transform 200ms ease;
}

.books .cover img:hover {
    transform: scale(1.05);
}

/* Asegurar que el contenido del libro no se superponga con la portada */
.books .fancydetail .fullclickpopup {
    margin: 0 0 4px 75px;
    min-height: 86px;
}

/* Book covers - Popup de detalle */
.bookpopup .cover {
    float: left;
    width: min(120px, 40vw);
    height: auto;
    margin: 4px 16px 12px 4px;
    overflow: hidden;
}

.bookpopup .cover img {
    width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: transform 200ms ease;
}

.bookpopup .cover img:hover {
    transform: scale(1.02);
}

/* Book popup specific styles */
.bookpopup h1 {
    color: var(--text);
    font-size: 1.8rem;
    margin-bottom: 16px;
    line-height: 1.3;
}

.bookpopup h1 a {
    color: var(--muted);
    margin-right: 8px;
    font-size: 0.9em;
}

.bookpopup h1 a:hover {
    color: var(--link-color);
}

.bookpopup h2 {
    clear: both;
    margin: 16px 0;
    padding-top: 12px;
    border-top: 1px solid var(--card-border);
}

.bookpopup h3 {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline;
}

.bookpopup p {
    margin: 8px 0;
    line-height: 1.6;
}

.bookpopup .popupless {
    color: var(--text);
}

.bookpopup .popupless a {
    color: var(--link-color);
}

.bookpopup .popupless a:hover {
    color: #cfe9ff;
}

/* Buttons and interactive elements */
button, input[type="submit"], .button {
    padding: 10px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    color: var(--text);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 180ms ease;
}

button:hover, input[type="submit"]:hover, .button:hover {
    background: var(--hover-bg);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Pill buttons similar to nodet.ar navigation */
.pill-btn {
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid var(--card-border);
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
    display: inline-block;
}

.pill-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.25);
    background: var(--hover-bg);
}

/* Media queries */
@media only screen and (min-width: 768px) {
    .container {
        box-shadow: none;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 32px 16px 48px;
    }
    
    header {
        padding: 16px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .headleft, .headright, .headcenter {
        order: initial;
        width: 100%;
        text-align: center;
        float: none;
    }
    
    .headleft, .headright {
        display: flex;
        justify-content: center;
        margin: 8px 0;
    }
    
    #tool {
        margin-top: 16px;
    }
    
    #searchForm {
        flex-direction: column;
    }
    
    .download {
        float: none;
        justify-content: center;
        margin-bottom: 16px;
    }
    
    .bookpopup .cover {
        float: none;
        margin: 0 auto 16px;
        text-align: center;
    }
    
    .bookpopup h1 {
        font-size: 1.5rem;
    }
    
    .bookpopup h2 {
        font-size: 1.2rem;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Selection color */
::selection {
    background: rgba(91, 141, 239, 0.3);
    color: var(--text);
}

::-moz-selection {
    background: rgba(91, 141, 239, 0.3);
    color: var(--text);
}
