/* General Styles */
body, html {
    font-family: 'Playfair Display', serif;
    margin: 0;
    padding: 0;
    background-color: #121212;
    color: #ffffff;
    transition: background-color 0.3s, color 0.3s;
}

/* Dark Mode Styles */
body.dark-mode {
    background-color: #121212;
    color: #ffffff;
}

body.light-mode {
    background-color: #f7f5eb;
    color: #000;
}

/* Container Styles */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1200px;
    width: 100%;
    padding: 20px;
    margin-left: 220px; /* Navbar width + spacing */
    min-height: 100vh;
    box-sizing: border-box;
}

/* Content Styles */
.content {
    width: 100%;
    padding-top: 40px;
    max-width: 800px;
    text-align: left;
}

.content h1, .content h2 {
    margin-bottom: 1rem;
}

.content p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

#artwork-title {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

#artwork-artist {
    margin-bottom: 1rem;
}

/* Navbar Styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 200px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 2rem;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    box-sizing: border-box;
}

.nav-item {
    color: #ffffff;
    text-decoration: none;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    transition: color 0.3s;
    text-transform: lowercase;
}

.nav-item:hover {
    color: #D4AF37;
}

.dark-mode-toggle {
    cursor: pointer;
    font-size: 1.2rem;
    margin-top: auto;
}

/* Button Group Styles */
.button-group {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Button Styles */
.button {
    background-color: #4caf50;
    border: none;
    color: #fff;
    text-align: center;
    display: inline-block;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s, transform 0.3s;
}

.button:hover {
    background-color: #388e3c;
    transform: scale(1.05);
}

/* Specific Styles for "Add to Favorites" Button */
.add-favorite-button {
    background-color: #ff5722;
}

.add-favorite-button:hover {
    background-color: #e64a19;
}

/* Painting Styles on Main Page */
.painting-main {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 6px #010101;
    margin-bottom: 2rem;
    transition: 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.painting-main:hover {
    transform: scale(1.05);
    border: 2px solid #000;
}

/* Info Styles */
.info {
    max-width: 100%;
    margin: 20px 0;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

body.light-mode .info {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Favorites Page Styles */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.favorite-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s;
}

.favorite-item img {
    width: 100%;
    height: auto;
    cursor: pointer;
    border-radius: 8px;
}

.favorite-item:hover {
    transform: scale(1.05);
}

.favorite-item .delete-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    padding: 5px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s, color 0.3s;
}

.favorite-item .delete-button:hover {
    background: rgba(255, 0, 0, 0.8);
    color: #fff;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    position: relative;
    margin: 60px auto;
    padding: 20px;
    width: 80%;
    max-width: 800px;
    background-color: #1e1e1e;
    border-radius: 8px;
    color: #fff;
}

.modal-content img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.modal-details {
    margin-top: 15px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-details h2 {
    margin-bottom: 10px;
}

.modal-details p {
    margin-bottom: 10px;
}

/* Close Button */
.close {
    color: #ffffff;
    position: absolute;
    top: 20px;
    right: 35px;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: #f1f1f1;
}

/* Loader Styles */
.loader-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

body.loading .loader-container {
    display: flex;
}

/* Toast Notification Styles */
#toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 16px;
    position: fixed;
    z-index: 1002;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 17px;
}

#toast.show {
    visibility: visible;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@keyframes fadein {
    from { bottom: 0; opacity: 0; }
    to { bottom: 30px; opacity: 1; }
}

@keyframes fadeout {
    from { bottom: 30px; opacity: 1; }
    to { bottom: 0; opacity: 0; }
}

/* About Page Specific Styles */
.about-content {
    text-align: left;
}

.additional-info {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #333;
}

.additional-info p {
    margin-bottom: 0.5rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .navbar {
        width: 100%;
        height: auto;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        padding: 1rem;
        position: fixed;
        top: 0;
        left: 0;
    }

    .nav-item {
        margin: 0 10px;
    }

    .dark-mode-toggle {
        margin: 0;
    }
    
    .nav-item:hover,
    .dark-mode-toggle:hover {
        color: #4caf50;
        transform: scale(1.1);
    }

    .container {
        margin-left: 0;
        padding-top: 80px;
    }

    .content {
        padding-top: 20px;
    }

    .painting-main {
        max-width: 100%;
    }

    .content h1 {
        font-size: 2rem;
    }
    
    .content h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 500px) {
    .button-group {
        flex-direction: column;
        align-items: stretch;
    }

    .button-group .button {
        width: 100%;
    }
}