﻿/*@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;700&display=swap');/* CSS Variables */

:root {
    color-scheme: light;
    --primary-color: #2a7de1;
    --secondary-color: #1a5dab;
    --light-gray: #f4f4f4;
    --dark-gray: #333;
    --white: #fff;
    --shadow: 0 5px 15px rgba(0,0,0,0.1);
}

@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes light-effect {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    background: url('../img/background.jpg') no-repeat center center fixed;
    background-size: 30%;
    background-position: center center;
    color: var(--dark-gray);
    padding-bottom: 15rem;
    position: relative;
    min-height: 100vh;
}

@media (max-width: 767px) {
    body {
        background-position: center center;
        background-size: 50%;
    }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: -1;
}

header {
    background: linear-gradient(to right, #1a5dab, #2a7de1, #1a5dab);
    color: var(--white);
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    background-size: 400% auto;
    animation: gradient-animation 7s ease infinite;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 70%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    animation: light-effect 4s infinite linear;
}

.settings-icon {
    position: absolute;
    top: 50%;
    right: 1.5rem;
    transform: translateY(-50%);
}

.settings-icon a {
    color: var(--white);
    font-size: 1.8rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.settings-icon a:hover {
    color: var(--secondary-color);
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2rem;
}

footer {
    background: linear-gradient(to right, #1a5dab, #2a7de1, #1a5dab);
    color: var(--white);
    padding: 1rem 0;
    position: fixed;
    bottom: 0;
    width: 100%;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    background-size: 400% auto;
    animation: gradient-animation 7s ease infinite;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 70%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    animation: light-effect 4s infinite linear;
}

footer nav {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 2rem;
}

@media (max-width: 767px) {
    footer nav {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
    }
}

footer nav a {
    color: var(--white);
    text-decoration: none;
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.5);
    background-color: transparent;
}

@media (max-width: 767px) {
    footer nav a {
        font-size: 1rem;
        padding: 0.4rem 0.8rem;
    }
}

footer nav a:hover, footer nav a.active {
    background-color: var(--secondary-color);
    border-color: var(--white);
}

.footer-icon {
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-icon img {
    height: 40px;
}

@media (min-width: 768px) {
    #homenageados, #antecessores {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 2rem;
        justify-items: center;
        align-items: start;
    }

    .person-card {
        width: 280px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .person-card img {
        height: 55%;
    }
}

section h2 {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--secondary-color);
}

.person-card {
    background-color: rgba(255,255,255,0.85);
    border: 3px solid rgba(42,125,225,0.18);
    border-radius: 14px;
    padding: 0;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow: hidden;
    width: 280px;
    min-height: 420px;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    backdrop-filter: blur(6px);
}

.person-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 28px rgba(0,0,0,0.18);
    border-color: rgba(42,125,225,0.32);
}

.person-card img {
    width: 100%;
    height: 55%;
    object-fit: cover;
    border-radius: 0;
    border: none;
}

.person-card .person-info {
    text-align: center;
    padding: 1rem 1.25rem 1.5rem 1.25rem;
    background-color: rgba(255, 255, 255, 0.35); /* TEST: more transparent so background shows through (desktop)") */
    color: var(--dark-gray);
    transition: background-color 200ms ease, color 200ms ease;
    backdrop-filter: blur(2px); /* subtle blur behind text for readability */
}

/* Slightly increase opacity on hover to improve readability */
.person-card:hover .person-info {
    background-color: rgba(255, 255, 255, 0.50);
}

/* Mobile: a bit more transparent to keep background visible */
@media (max-width: 767px) {
    .person-card .person-info {
        background-color: rgba(255, 255, 255, 0.20); /* TEST: mobile more transparent */
        backdrop-filter: blur(2px);
    }
    .person-card:hover .person-info {
        background-color: rgba(255, 255, 255, 0.40);
    }
}

.person-card h3 {
    color: var(--secondary-color);
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.person-card p {
    font-size: 1rem;
    line-height: 1.6;
}

@media (max-width: 767px) {
    .person-card {
        width: 100%;
        min-height: auto;
        margin: 0 auto;
        overflow: hidden;
        padding-bottom: 0.75rem;
        border-radius: 12px;
    }

    .person-card img {
        width: 100%;
        height: auto;
        max-height: none;
        object-fit: contain;
        object-position: center center;
        display: block;
        border-radius: 12px 12px 0 0;
    }

    .person-card .person-info {
        padding-top: 0.75rem;
    }
}

#upload-form {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.form-group select, .form-group input[type="file"], .form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

#upload-form button {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

#upload-form button:hover {
    background-color: var(--secondary-color);
}

#image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.person-item {
    background-color: var(--white);
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.person-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 0.5rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: transparent;
    padding: 0;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90%;
    max-height: 90%;
}

#modal-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#modal-actions {
    margin-top: 1.5rem;
    width: 100%;
    display: flex;
    justify-content: center;
}
    box-shadow: var(--shadow);
    text-align: center;
    width: 400px;
}

.modal-content h3 {
    color: var(--secondary-color);
    margin-top: 0;
}

.modal-content input {
    width: 100%;
    padding: 0.8rem;
    margin-top: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}

.modal-content button {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
}

.modal-content button:hover {
    background-color: var(--secondary-color);
}

.close-button {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

#modal-image {
    max-width: 80%;
    max-height: 80%;
    border-radius: 14px;
    border: 4px solid var(--primary-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #4a7ba7, #6b9ec3);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-size: 0.95rem;
    font-weight: 500;
    max-width: 300px;
    z-index: 2000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    word-wrap: break-word;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 767px) {
    .toast-notification {
        top: 10px;
        right: 10px;
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
        max-width: 250px;
    }
}

.delete-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #ff0000;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
}

.delete-icon:hover {
    color: #cc0000;
    transform: scale(1.2);
}

.person-item-actions {
    position: relative;
    width: 100%;
    height: 0;
}

/* Extra spacing for mobile cards: increase gap between story cards */
@media (max-width: 767px) {
    .person-card {
        margin-bottom: 2.8rem; /* increased space between cards on mobile */
    }
    /* If container uses gap, ensure it's applied on mobile too */
    #homenageados, #antecessores {
        display: block;
    }
}

/* PDF Download Button */
.pdf-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.1);
}

.pdf-download-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.pdf-download-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pdf-download-btn i {
    margin-right: 8px;
    font-size: 1.1rem;
}

/* Ensure person-info handles the button nicely */
.person-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}
