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

:root {
    --bg: #0a0a0b;
    --surface: #16161a;
    --surface-hover: #1c1c21;
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --error: #ef4444;
    --success: #22c55e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    color-scheme: dark;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
    animation: fadeIn 0.6s ease forwards;
}

/* Auth Page */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(rgba(10, 10, 11, 0.75), rgba(10, 10, 11, 0.95)), 
                url('https://www.ericeiramag.pt/wp-content/uploads/2021/02/bibliotecas.png') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed;
}

.login-card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.logo {
    display: block;
    margin: 0 auto 1.5rem;
    max-width: 120px;
    height: auto;
}

h1, h2, h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.input-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

select option {
    background-color: #ffffff !important; /* Fundo branco para segurança */
    color: #000000 !important;           /* Texto preto para visibilidade */
}

.btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* Dashboard */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

.main-content {
    padding: 2rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.grid-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.card {
    background: var(--surface);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.card:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
    transform: translateY(-5px);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: var(--primary-glow);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    color: var(--primary);
}

/* Tables */
.table-container {
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid var(--border);
    overflow: hidden;
    margin-top: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: rgba(255, 255, 255, 0.02);
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-alert { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.badge-success { background: rgba(34, 197, 94, 0.1); color: #22c55e; }

/* Responsive */
@media (max-width: 768px) {
    .nav { padding: 1rem; }
    .nav-links { display: none; }
    .grid-menu { grid-template-columns: 1fr; }
}

/* Auto-fill styling */
#book-preview {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px dashed var(--border);
}

#book-preview img {
    max-width: 80px;
    border-radius: 8px;
}
