/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #1d1f20;
    color: #dcdcdc;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Header */
header {
    width: 100%;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2c3e50;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.title {
    font-size: 1.5rem;
    color: #ecf0f1;
    font-weight: 600;
}

.search-bar {
    padding: 8px 12px;
    border-radius: 5px;
    border: none;
    background: #34495e;
    color: #ecf0f1;
    font-size: 1rem;
    width: 300px;
    transition: background 0.3s ease;
}

.search-bar::placeholder {
    color: #95a5a6;
}

.search-bar:focus {
    outline: none;
    background: #3d566e;
}

/* Thumbnail Gallery */
.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.thumbnail {
    position: relative;
    background: #34495e;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.thumbnail img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.thumbnail-caption {
    padding: 10px;
    text-align: center;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
}

.thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
}

.lock-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #ff4757;
    font-size: 1.2rem;
}

/* Password Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.modal-content {
    background: #2c3e50;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    position: relative;
    width: 300px;
}

.modal-content h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #ecf0f1;
}

.modal-content input {
    padding: 10px;
    border-radius: 5px;
    border: none;
    margin: 10px 0;
    width: 100%;
    background: #34495e;
    color: #ecf0f1;
    font-size: 1rem;
}

.modal-content button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background: #1abc9c;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s ease;
    width: 100%;
    font-size: 1rem;
}

.modal-content button:hover {
    background: #16a085;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #ecf0f1;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #ff4757;
}

/* Light/Dark Mode */
.light-mode {
    background-color: #f0f0f0;
    color: #333333;
}

.light-mode header {
    background: #ffffff;
}

.light-mode .title,
.light-mode .search-bar {
    color: #333333;
}

.light-mode .thumbnail {
    background: #e0e0e0;
}

.light-mode .thumbnail-caption {
    background: rgba(255, 255, 255, 0.8);
    color: #333333;
}

.light-mode .modal-content {
    background: #ffffff;
    color: #333333;
}

.light-mode .modal-content h3 {
    color: #333333;
}

.light-mode .modal-content input {
    background: #f0f0f0;
    color: #333333;
}

.mode-toggle-button {
    position: fixed;
    left: 20px;
    bottom: 20px;
    background: #2c3e50;
    color: #ecf0f1;
    font-size: 1.2rem;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease, color 0.3s ease;
}

.light-mode .mode-toggle-button {
    background: #e0e0e0;
    color: #333333;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background: #2c3e50;
    margin-top: 40px;
    color: #ecf0f1;
}

footer a {
    color: #1abc9c;
    text-decoration: none;
    transition: text-decoration 0.3s ease;
}

footer a:hover {
    text-decoration: underline;
}