:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --accent-color: #38bdf8;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none; /* Prevent text selection as a basic security measure */
}

body {
    background-color: var(--bg-color);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    padding: 2rem;
    background-image: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 4rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.carnet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
    justify-items: center;
}

.carnet-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    box-shadow: var(--glass-shadow);
}

.carnet-card:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(56, 189, 248, 0.2);
    z-index: 20;
    border-color: var(--accent-color);
}

/* Security Overlay */
.photo-container {
    width: 100%;
    position: relative;
    line-height: 0;
    overflow: hidden; /* Para que el zoom de la imagen no se salga */
}

.photo-container img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
    transition: transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}

.carnet-card:hover img {
    transform: scale(1.15);
}

.security-shield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background: transparent;
    /* This invisible div prevents "Save As" on the image below */
}

.hologram-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.08) 50%,
        rgba(255,255,255,0) 100%
    );
    z-index: 5;
    pointer-events: none;
    transition: transform 0.6s ease;
    transform: translateX(-100%);
}

.carnet-card:hover .hologram-effect {
    transform: translateX(100%);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 10px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-photo-container {
    position: relative;
    line-height: 0;
    border-radius: 10px;
    overflow: hidden;
}

.modal-photo-container img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
    pointer-events: none;
}

.close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--accent-color);
}

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

.carnet-card {
    animation: fadeIn 0.6s ease forwards;
    cursor: pointer; /* Indicar que es clickable */
}

/* Print protection */
@media print {
    body {
        display: none !important;
    }
}
