/* /public/css/styles.css */
/* ==================== BASE ==================== */
* {
    box-sizing: border-box;
}

body {
    background-color: #E1E3E1;
    color: #212529;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
}

/* ==================== TYPOGRAPHY ==================== */
h1 {
    font-size: 2.5em;
    font-weight: 600;
    margin: 10px 0;
}

h2 {
    font-size: 1.8em;
    font-weight: 600;
    margin: 10px 0;
}

h3 {
    font-size: 1.5em;
    font-weight: 400;
    margin: 10px 0;
}

h4 {
    font-size: 1.2em;
    font-weight: 400;
    margin: 10px 0;
}

p {
    color: #333;
    font-size: 1.1em;
    margin: 8px 0;
}

/* ==================== HEADER ==================== */
.header {
    align-items: center;
    background-color: black;
    color: white;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-between;
    padding: 12px 20px;
}

.link_area {
    align-items: center;
    display: flex;
    gap: 20px;
}

.home_link {
    color: white;
    font-size: 1.6em;
    font-weight: 600;
    text-decoration: none;
}

.nav_bar {
    display: flex;
    gap: 15px;
}

.nav_button {
    border-radius: 4px;
    color: white;
    padding: 6px 12px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.nav_button:hover {
    background-color: rgba(255,255,255,0.1);
}

/* ==================== FOOTER ==================== */
.footer {
    align-items: center;
    background-color: black;
    bottom: 0;
    color: white;
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    position: fixed;
    width: 100%;
    z-index: 100;
}

.copyright {
    color: white;
    margin: 0;
}

.admin-buttons {
    display: flex;
    gap: 10px;
}

.login_button {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 4px;
    color: white;
    font-size: 15px;
    padding: 8px 16px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.login_button:hover {
    background-color: white;
    border-color: white;
    color: black;
}

/* ==================== BUTTONS ==================== */
.btn {
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    padding: 10px 20px;
    transition: all 0.2s;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #45a049;
}

.delete-btn {
    background: #e74c3c;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    padding: 6px 12px;
}

.delete-btn:hover {
    background: #c0392b;
}

/* ==================== FORMS ==================== */
.form-input {
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    margin-bottom: 15px;
    padding: 12px;
    width: 100%;
}

/* ==================== HOME ==================== */
.main-container {
    padding: 20px 0 90px 0;
    text-align: center;
}

.section {
    margin: 0 auto;
    max-width: 1100px;
    padding: 0 20px;
}

.bio {
    font-size: 1.08em;
    line-height: 1.75;
    margin: 40px auto;
    max-width: 1100px;
    padding: 0 20px;
    text-align: justify;
}

.bio p {
    margin-bottom: 1.4em;
}

.home-image-container {
    margin: 30px auto;
    max-width: 800px;
}

.home-image {
    border: 3px solid black;
    border-radius: 10px;
    display: block;
    height: auto;
    padding: 2px;
    width: 100%;
}

.gallery-link-container {
    margin: 50px 0 30px 0;
    text-align: center;
}

.btn-gallery {
    background: #222;
    border: 3px solid #222;
    border-radius: 50px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    color: white;
    display: inline-block;
    font-size: 1.25rem;
    font-weight: 600;
    padding: 16px 40px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-gallery:hover {
    background: white;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
    color: #222;
    transform: translateY(-3px);
}

.btn-gallery:active {
    transform: scale(0.98);
}

/* ==================== ADMIN ==================== */
.admin-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin: 40px auto;
    max-width: 1300px;
    padding: 35px;
}

.admin-card {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 10px;
    margin-bottom: 30px;
    padding: 25px;
}

.controls-bar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.controls-bar h2 {
    font-size: 1.4em;
    margin: 0;
}

.per-page-container label {
    align-items: center;
    color: #555;
    display: flex;
    font-size: 15px;
    gap: 8px;
    white-space: nowrap;
}

.per-page-container select {
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
    height: 34px;
    line-height: 1;
    margin: 0;
    padding: 6px 10px;
    vertical-align: middle;
}

.taken-source {
    color: #666;
	cursor: help;
    font-size: 0.85em;
    margin-left: 4px;
}

.taken-source:hover {
    color: #333;
    text-decoration: underline;
}

/* ==================== TABLE ==================== */
.admin-table {
    border-collapse: collapse;
    width: 100%;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.admin-table th {
    background-color: #f4f4f4;
    cursor: pointer;
}

.admin-table th:hover {
    background-color: #e0e0e0;
}

/* ============= ADMIN UPLOAD DROP ZONE ============ */
.drop-zone {
    background: #fafafa;
    border: 3px dashed #ccc;
    border-radius: 12px;
    cursor: pointer;
    margin: 15px 0;
    padding: 50px 20px;
    text-align: center;
    transition: all 0.2s ease;
}

.drop-zone.dragover {
    background: #f0fff0;
    border-color: #4CAF50;
    transform: scale(1.02);
}

.drop-zone p {
    color: #666;
    font-size: 16px;
    margin: 8px 0;
}

.upload-label {
    cursor: pointer;
}

.upload-status {
    border-radius: 6px;
    font-weight: 500;
    padding: 15px;
    text-align: center;
}

/* ==================== GALLERY ==================== */
main h2 {
    color: #212529;
    margin: 30px 0 15px 0;
    text-align: center;
}

main p {
    color: #555;
    margin-bottom: 25px;
    text-align: center;
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    padding: 20px 20px 40px;
}

.gallery-item {
    align-items: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
}

.gallery-image {
	cursor: zoom-in;
    display: block;
    height: 280px;
    max-width: 100%;
    object-fit: contain;
    width: auto;
	z-index: 2;
}

.caption {
    align-items: center;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    color: #444;
    display: flex;
    font-size: 14px;
    justify-content: center;
    line-height: 1.4;
    min-height: 52px;
    overflow: hidden;
    padding: 10px 12px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

/* Sort buttons */
.sort-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 25px 0;
}

.sort-button {
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    color: #333;
    font-size: 15px;
    padding: 10px 18px;
    text-decoration: none;
    transition: all 0.2s;
}

.sort-button:hover {
    background: #f0f0f0;
}

.sort-button.active {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
}

/* ==================== FEATURED ROW (Best Moments) ==================== */
.featured-row {
    align-items: center;
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 50px 0 40px 0;
    width: 100%;
}

.decor-left,
.decor-right {
    background: linear-gradient(to right, transparent, #333, transparent);
    flex: 1;
    height: 2px;
    position: relative;
}

.decor-left::before,
.decor-right::before {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 100'%3E%3Cpath d='M0 50 Q100 10 200 50 Q300 90 400 50 Q500 10 600 50 Q700 90 800 50' fill='none' stroke='%23333' stroke-width='8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    content: '';
    height: 50px;
    opacity: 0.6;
    position: absolute;
    top: -25px;
    width: 220px;
}

.decor-left::before {
    left: 0;
    transform: scaleX(-1);   /* mirror for left side */
}

.decor-right::before {
    right: 0;
}

/* Featured Item Styling */
.featured-item {
    background: white;
    border: 6px solid #222;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
    max-width: 800px;
    overflow: hidden;
    width: 100%;
}

.featured-image {
    display: block;
    height: 520px;           /* taller than normal images */
    object-fit: cover;
    width: 100%;
}

.section-title {
    color: #333;
    font-size: 1.6em;
    font-weight: 600;
    margin: 60px 0 30px 0;
    text-align: center;
}

/* Best Moments normal gallery */
.best-gallery {
    justify-content: center;
}

.best-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 40px 0;
    width: 100%;
}

.best-row .gallery-item {
    flex: 1 1 300px;           /* grow but keep reasonable minimum width */
    margin-bottom: 20px;
    max-width: 320px;
}

/* Optional: Make it exactly 3 per row on larger screens */
@media (min-width: 1200px) {
    .best-row .gallery-item {
        flex: 1 1 32%;
        max-width: 32%;
    }
}

.best-moments-section {
    margin: 60px 0;
}

.section-title {
    color: #333;
    font-size: 1.8em;
    margin: 20px 0 40px 0;
    text-align: center;
}

/* ==================== PAGINATION ==================== */
.pagination {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 30px 0;
}

.pagination button,
.pagination .ellipsis {
    align-items: center;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    display: inline-flex;
    font-size: 15px;
    height: 38px;
    justify-content: center;
    line-height: 1;
    min-width: 42px;
    padding: 8px 12px;
    vertical-align: middle;
}

.pagination button.active {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
}

.pagination button:hover:not(.active) {
    background: #f0f0f0;
}

.pagination .ellipsis {
    background: transparent;
    border: none;
    color: #666;
    min-width: 42px;
    padding: 8px 4px;
}

/* ==================== FULLSCREEN IMAGE LIGHTBOX ==================== */
#fullscreen-modal {
    align-items: center;
    background-color: rgba(0, 0, 0, 0.98);
    display: none;
    height: 100%;
    justify-content: center;
    left: 0;
    overflow: auto;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 10000;
}

#fullscreen-image {
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(0,0,0,0.9);
    max-height: 96vh;
    max-width: 96%;
    object-fit: contain;
}

#close-modal {
    color: #fff;
    cursor: pointer;
    font-size: 50px;
    font-weight: bold;
    position: absolute;
    right: 30px;
    text-shadow: 0 2px 15px rgba(0,0,0,0.9);
    top: 20px;
    user-select: none;
    z-index: 10001;
}

#close-modal:hover {
    color: #ccc;
    transform: scale(1.1);
}

/* ==================== ADMIN GALLERY CONTROLS ==================== */
.gallery-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
	cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
}

.caption {
    background: #f9f9f9;
    border-top: 1px solid #eee;
    color: #444;
    font-size: 14px;
    min-height: 52px;
    padding: 10px 12px;
    text-align: center;
}

.admin-controls {
    align-items: center;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 10px 14px;
    width: 100%;
	z-index: 5;
}

.feature-label {
    align-items: center;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    font-size: 14px;
    gap: 6px;
    margin: 0;
    padding: 4px 8px;
    transition: background 0.2s;
}

.feature-label:hover {
    background: #f0f0f0;
}

.feature-label input[type="checkbox"] {
    accent-color: #4CAF50;
    height: 18px;
    width: 18px;
}

.delete-overlay {
    align-items: center;
    background: rgba(0, 0, 0, 0.75);
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    color: white;
    cursor: pointer;
    display: none;
    font-size: 18px;
    height: 36px;
    justify-content: center;
	pointer-events: auto;
    position: absolute;
    right: 12px;
    top: 12px;
    width: 36px;
    z-index: 10;
}

.gallery-item:hover .delete-overlay {
    display: flex;
}

.delete-overlay:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

/* ==================== OTHER ==================== */
.success-msg {
    background: #d4edda;
    border-left: 5px solid #4CAF50;
    border-radius: 6px;
    color: #155724;
    margin: 20px 0;
    padding: 15px 18px;
}

.photo-thumb {
    border-radius: 4px;
    max-height: 80px;
    max-width: 80px;
}

.truncated {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==================== ADMIN LOGIN ==================== */
body.admin-login {
    align-items: center;
    background: #f4f4f4;
    display: flex;
    font-family: Arial, sans-serif;
    height: 100vh;
    justify-content: center;
    margin: 0;
}

.login-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-width: 400px;
    padding: 40px;
    width: 100%;
}

.login-container h1 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.login-container form {
    display: flex;
    flex-direction: column;
}

.login-container input {
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    margin: 10px 0;
    padding: 12px;
}

.login-container button {
    background: #007bff;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
    padding: 12px;
}

.login-container button:hover {
    background: #0056b3;
}

.login-container .error {
    color: red;
    margin: 10px 0;
    text-align: center;
}

.login-container .back-link {
    margin-top: 20px;
    text-align: center;
}

/* ==================== LOGIN MODAL ==================== */
.modal {
    align-items: center;
    background: rgba(0, 0, 0, 0.75);
    display: none;                    /* starts hidden */
    height: 100%;
    justify-content: center;
    left: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 420px;
    padding: 30px 40px;
    position: relative;
    width: 90%;
}

.modal .close {
    color: #666;
    cursor: pointer;
    font-size: 32px;
    position: absolute;
    right: 20px;
    top: 15px;
}

.modal .close:hover {
    color: #000;
}

.modal input {
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    margin: 10px 0;
    padding: 12px;
    width: 100%;
}

.modal button {
    background: #007bff;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
    padding: 14px;
    width: 100%;
}

.modal button:hover {
    background: #0056b3;
}
