/* style.css - Premium Edition */
:root {
    --bg-color: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.7);
    --glass-bg: rgba(33, 38, 45, 0.4);
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --accent-glow: rgba(88, 166, 255, 0.4);
    --border-color: rgba(48, 54, 61, 0.8);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(88, 166, 255, 0.05) 0, transparent 50%),
        radial-gradient(at 100% 100%, rgba(88, 166, 255, 0.05) 0, transparent 50%);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

header {
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 3rem 1rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

h1 {
    font-weight: 600;
    letter-spacing: -1px;
    font-size: 2.5rem;
}

h1 span {
    color: var(--accent);
    font-weight: 300;
    margin-left: 0.2rem;
    text-transform: uppercase;
    font-size: 1.2rem;
    letter-spacing: 4px;
    display: block;
}

.search-container {
    margin-top: 2rem;
    position: relative;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

#searchInput {
    width: 100%;
    padding: 1.2rem 4rem 1.2rem 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    color: white;
    font-size: 1.1rem;
    transition: var(--transition);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

#searchInput:focus {
    border-color: var(--accent);
    outline: none;
    background: rgba(33, 38, 45, 0.8);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: scale(1.02);
}

#searchIcon {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    opacity: 0.6;
}

#stats {
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.ficha-card {
    background: var(--glass-bg);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 180px;
    position: relative;
    overflow: hidden;
}

.ficha-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent) 0%, transparent 100%);
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.ficha-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.ficha-card:hover::before {
    opacity: 0.05;
}

.ref-code {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.file-count {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 12, 16, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.hidden { display: none; }

.modal-content {
    background: var(--bg-color);
    width: 95%;
    height: 95%;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.pdf-container {
    flex-grow: 1;
    background: #1e1e1e;
}

#pdfViewer {
    width: 100%;
    height: 100%;
    border: none;
}

#closeModal {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

#closeModal:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
    margin: 4rem auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

footer {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
}
