/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    background-color: #ffffff; /* White background */
    color: #333333; /* Dark grey text */
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Links */
a {
    color: #000000; /* Black links */
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #555555; /* Darker grey on hover */
}

/* Default header styles - these are overridden by .main-header for the main site */
header {
    background-color: #ffffff; /* White header background */
    color: #000000; /* Black header text */
    padding: 1.5rem 0;
    border-bottom: 1px solid #eeeeee; /* Light grey border */
    margin-bottom: 2rem;
}

header .container,
header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #000000;
    margin: 0;
}

header nav a {
    margin-left: 1.5rem;
    font-size: 1rem;
    padding: 0.5rem 0; /* Add padding for easier clicking */
    border-bottom: 2px solid transparent; /* Underline effect on hover */
    transition: border-color 0.3s ease, color 0.3s ease;
}

header nav a:hover {
    color: #000000;
    border-bottom-color: #000000;
}

/* Language switcher - Dark Theme */
.language-switcher {
    display: flex;
    margin-left: 1.5rem;
    position: relative;
}

.language-switcher-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    border: 1px solid #333333;
    background-color: #222222;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-decoration: none;
    outline: none;
}

.language-switcher-toggle:hover {
    background-color: #333333;
    border-color: #444444;
}

.language-switcher-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background-color: #222222;
    border: 1px solid #333333;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 100;
    overflow: hidden;
    display: none;
}

.language-switcher:hover .language-switcher-dropdown {
    display: block;
}

.language-switcher-dropdown a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;
    margin: 0;
    border: none;
    border-bottom: 1px solid #333333;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.3s ease;
    color: #ffffff;
    min-width: 100px;
    text-align: center;
    text-decoration: none;
    outline: none;
}

.language-switcher-dropdown a:last-child {
    border-bottom: none;
}

.language-switcher-dropdown a:hover {
    background-color: #333333;
    border-bottom-color: #444444;
    transform: translateX(3px);
}

.language-switcher-dropdown a.active {
    background-color: #444444;
    font-weight: 600;
    position: relative;
    border: none;
    outline: none;
    box-shadow: none;
}

.language-switcher-dropdown a:focus,
.language-switcher-dropdown a:active {
    outline: none;
    border: none;
    box-shadow: none;
}

.language-switcher-dropdown a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #ffffff;
}

/* Main content */
main {
    padding: 2rem 0;
}

/* Button styles (General) */
.btn {
    display: inline-block;
    background-color: #000000; /* Black background */
    color: #ffffff; /* White text */
    border: 1px solid #000000;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-decoration: none; /* Ensure buttons that are links look like buttons */
}

.btn:hover {
    background-color: #333333; /* Darker grey background on hover */
    border-color: #333333;
    color: #ffffff;
}

/* Specific Button Styles */
.btn-primary {
    /* Inherits .btn styles (Black background, white text) */
}

.btn-secondary { /* For View Blog button */
    background-color: #f0f0f0; /* Light grey background */
    color: #333333; /* Dark text */
    border-color: #cccccc; /* Grey border */
}

.btn-secondary:hover {
    background-color: #e0e0e0; /* Darker grey background */
    border-color: #bbbbbb;
    color: #000000;
}

.btn-danger {
    background-color: #ffffff; /* White background */
    color: #D32F2F; /* Red text */
    border-color: #D32F2F; /* Red border */
}

.btn-danger:hover {
    background-color: #D32F2F; /* Red background */
    color: #ffffff; /* White text */
    border-color: #D32F2F;
}

.logout-btn {
    /* Inherits .btn styles */
    background-color: #ffffff;
    color: #555555;
    border-color: #cccccc;
    padding: 0.5rem 1rem; /* Slightly smaller padding */
}

.logout-btn:hover {
    background-color: #f5f5f5;
    border-color: #aaaaaa;
    color: #333333;
}

.edit-btn { /* Making Edit a bit more subtle */
    display: inline-block;
    color: #555555; /* Grey color */
    text-decoration: none; /* Remove underline */
    margin-right: 15px; /* Increased Space between edit and delete */
    padding: 0.6rem 0;
    border-bottom: 1px dotted #cccccc; /* Subtle dotted underline */
    transition: color 0.3s ease, border-color 0.3s ease;
}
.edit-btn:hover {
    color: #000000; /* Black on hover */
    border-bottom-color: #000000;
}

/* Posts */
.posts-list {
    margin-top: 2rem;
}
.post, .post-card {
    background: #ffffff;
    border: 1px solid #eeeeee; /* Light grey border */
    border-radius: 5px;
    margin-bottom: 2rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.post h2, .post h3, .post-card h3 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    color: #000000;
    font-weight: 600;
}

/* Blog page specific post styling */
.blog-page .post {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.blog-page .post h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: #000000;
    font-weight: 600;
}

.blog-page .post-content {
    font-size: 1rem;
    line-height: 1.8;
}

.blog-page .post-media {
    margin-top: 1.5rem;
}

.blog-page .post-media img,
.blog-page .post-media video {
    border-radius: 6px;
    max-height: 400px; /* Larger images for narrower layout */
}

.post-date {
    font-size: 0.9rem;
    color: #888888; /* Medium grey */
    margin-bottom: 1.5rem;
    display: block; /* Ensure it takes its own line */
}

.post-content {
    color: #333333;
    line-height: 1.7;
}

.post-media {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.post-media img,
.post-media video {
    width: 100%;
    height: auto;
    max-height: 300px; /* Limit media height */
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eeeeee;
}

/* Audio player styles */
.post-audio {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #eeeeee;
}

.post-audio h4 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: #333333;
}

.post-audio audio {
    width: 100%;
    margin-top: 0.5rem;
}

.post-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eeeeee;
    display: flex;
    align-items: center;
}

/* Login Form */
#loginForm {
    max-width: 450px;
    margin: 3rem auto;
    padding: 2.5rem;
    background-color: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

#loginForm h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: #000000;
    font-weight: 600;
}

#loginForm form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#loginForm label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333333;
}

#loginForm input[type="text"],
#loginForm input[type="password"] {
    padding: 0.8rem;
    border: 1px solid #cccccc; /* Slightly darker border for inputs */
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
}

#loginForm input[type="text"]:focus,
#loginForm input[type="password"]:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

#loginForm button {
    padding: 0.8rem;
    font-size: 1rem;
    /* Inherits .btn styles */
}

/* Admin Panel */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Admin Panel - Specific styling with !important to ensure it takes priority */
.admin-container .admin-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 30px !important;
    padding: 20px !important;
    background-color: #000 !important; /* Pure black background */
    border-bottom: 1px solid #333 !important;
    border-radius: 5px 5px 0 0 !important;
    color: #fff !important;
}

.admin-container .admin-header h1 {
    font-size: 1.8rem !important;
    color: #fff !important; /* White text */
    margin: 0 !important;
    font-weight: 600 !important;
}

.admin-container .admin-header nav a.btn-secondary {
    background-color: #333 !important;
    color: #fff !important;
    border-color: #444 !important;
}

.admin-container .admin-header nav a.btn-secondary:hover {
    background-color: #444 !important;
    border-color: #555 !important;
    color: #fff !important;
}

.admin-container .admin-header nav a.logout-btn {
    background-color: #333 !important;
    color: #fff !important;
    border-color: #444 !important;
}

.admin-container .admin-header nav a.logout-btn:hover {
    background-color: #444 !important;
    border-color: #555 !important;
    color: #fff !important;
}

/* Keep the original admin styling for backwards compatibility */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #000; /* Changed to black for more contrast */
    border-bottom: 1px solid #333; /* Darker border */
    border-radius: 5px 5px 0 0;
    color: #fff; /* Ensuring text color is white */
}

.admin-header h1 {
    font-size: 1.8rem;
    color: #fff; /* White text */
    margin: 0;
    font-weight: 600;
}

.admin-header nav a {
    color: #fff; /* White links */
    margin-left: 1.5rem;
    font-size: 1rem;
}

.admin-header .btn-secondary {
    background-color: #333; /* Dark gray background */
    color: #fff; /* White text */
    border-color: #444;
}

.admin-header .btn-secondary:hover {
    background-color: #444;
    border-color: #555;
    color: #fff;
}

.admin-header .logout-btn {
    background-color: #333;
    color: #fff;
    border-color: #444;
}

.admin-header .logout-btn:hover {
    background-color: #444;
    border-color: #555;
    color: #fff;
}

.admin-panel, .admin-form {
    background: #fff;
    padding: 2rem;
    border-radius: 5px;
    border: 1px solid #eeeeee;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.admin-panel h2, .admin-form h2 {
    margin-bottom: 1.5rem;
    color: #000;
    font-weight: 600;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eeeeee;
}

/* Form styles (Admin) */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 500;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #cccccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-group input[type="file"] {
    padding: 0.5rem 0;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="number"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

/* Error Message */
.error {
    color: #D32F2F; /* Red */
    background-color: #FFCDD2; /* Light red background */
    border: 1px solid #D32F2F;
    padding: 0.8rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    text-align: center;
}

/* No posts message */
.no-posts {
    text-align: center;
    padding: 3rem;
    background: #fafafa; /* Very light grey */
    border: 1px dashed #dddddd;
    border-radius: 5px;
    color: #888888;
}

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }
    header nav {
        flex-direction: column;
        align-items: flex-start;
    }
    header nav a {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    .posts-grid {
        grid-template-columns: 1fr;
    }

    /* Responsive language switcher */
    .language-switcher {
        margin-left: 0;
        margin-top: 1rem;
        align-self: flex-start;
    }

    .language-switcher-dropdown {
        left: 0;
        right: auto;
    }
}

/* Make all form buttons black with white text like the Save button */
button,
input[type="submit"],
input[type="button"],
.btn-primary {
    display: inline-block;
    background-color: #000000 !important; /* Black background */
    color: #ffffff !important; /* White text */
    border: 1px solid #000000 !important;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    transition: background-color 0.3s ease;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.btn-primary:hover {
    background-color: #333333 !important; /* Darker grey on hover */
    border-color: #333333 !important;
}

/* Style file input button */
input[type="file"] {
    border: none;
    padding: 0;
}

input[type="file"]::file-selector-button {
    background-color: #000000;
    color: #ffffff;
    border: 1px solid #000000;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    margin-right: 1rem;
    transition: background-color 0.3s ease;
}

input[type="file"]::file-selector-button:hover {
    background-color: #333333;
    border-color: #333333;
}

/* Update main header to black with white text */
.main-header {
    background-color: #000 !important; /* Pure black header background */
    color: #fff !important; /* White header text */
    padding: 1.5rem 0;
    border-bottom: 1px solid #333333; /* Darker border */
    margin-bottom: 2rem;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #fff !important;
    margin: 0;
}

.main-header nav {
    display: flex;
    gap: 1rem;
}

.main-header nav a,
.main-header nav a:link,
.main-header nav a:visited {
    color: #fff !important; /* Force white text */
    font-size: 1rem;
    background-color: #000 !important; /* Black background */
    border: 1px solid #fff !important; /* White border */
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
    text-decoration: none !important;
    display: inline-block !important;
}

.main-header nav a:hover,
.main-header nav a:active {
    background-color: #333 !important; /* Dark gray on hover */
    color: #fff !important; /* Force white text on hover */
    border-color: #fff !important;
}

.main-header nav a.admin-link {
    background-color: #333333;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: none;
}

.main-header nav a.admin-link:hover {
    background-color: #555555;
}

/* Section containers - default for all pages */
.section-container {
    max-width: 1080px; /* Increased from 900px */
    margin: 0 auto; /* Centers the container */
    padding: 0 1rem; /* Padding on the sides */
}

/* Blog page (index.php) - narrower content */
.blog-page .section-container {
    max-width: 840px; /* Increased from 600px for ~70% width */
}

/* Work page - full width for gallery */
.work-page .section-container {
    max-width: 1200px;
}

/* Contact page - medium width */
.contact-page .section-container {
    max-width: 900px;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eeeeee;
    color: #000000;
}

/* Work Gallery Styles */
.work-intro {
    margin-bottom: 2rem;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.work-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.gallery-item {
    border-radius: 5px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.gallery-item h3 {
    padding: 1rem 1rem 0.5rem;
    margin: 0;
    font-size: 1.2rem;
}

.gallery-item p {
    padding: 0 1rem 1rem;
    margin: 0;
    color: #666666;
    font-size: 0.9rem;
}

/* Contact section */
.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.contact-item {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.contact-item h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    color: #000000;
}

.contact-item p {
    margin: 0;
}

.contact-item a {
    color: #000000;
    text-decoration: none;
    border-bottom: 1px dotted #cccccc;
}

.contact-item a:hover {
    border-bottom-color: #000000;
}

/* Footer */
footer {
    background-color: #f8f8f8;
    padding: 2rem 0;
    text-align: center;
    color: #666666;
    border-top: 1px solid #eeeeee;
}

/* Lightbox customization */
.lb-data .lb-caption {
    font-size: 1rem;
    font-weight: 600;
}

.lb-data .lb-details {
    width: 100%;
    padding: 0.5rem 1rem;
}

/* Admin navigation */
.admin-navigation {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 0.5rem 0;
    flex-wrap: wrap;
}

.admin-navigation a {
    padding: 0.6rem 1.2rem;
    background-color: #f5f5f5;
    color: #333;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.admin-navigation a:hover {
    background-color: #e0e0e0;
}

.admin-navigation a.active {
    background-color: #000;
    color: #fff;
}

/* Work gallery items in admin panel */
.work-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.work-item {
    border: 1px solid #eee;
    border-radius: 5px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.work-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.work-item h4 {
    padding: 0.8rem 1rem 0.3rem;
    margin: 0;
    font-size: 1rem;
}

.work-item p {
    padding: 0 1rem 0.8rem;
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.work-item-actions {
    padding: 0.8rem 1rem;
    border-top: 1px solid #eee;
}

.add-work-form {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.add-work-form h3 {
    margin-bottom: 1.5rem;
}

/* Add spacing between sections in admin panel */
.admin-panel {
    margin-bottom: 3rem;
}

.admin-panel h2 {
    margin-bottom: 1.5rem;
}

.admin-panel h3 {
    margin-bottom: 1.2rem;
    color: #000;
    font-weight: 600;
}

/* Mobile-friendly menu styles */
@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 1rem 0;
    }

    .main-header h1 {
        font-size: 1.6rem;
        margin-bottom: 0.5rem;
    }

    .main-header nav {
        width: 100%;
        display: flex;
        justify-content: space-between;
        padding: 0 1rem;
        gap: 0.5rem;
    }

    .main-header nav a,
    .main-header nav a:link,
    .main-header nav a:visited {
        flex: 1;
        padding: 0.8rem 0;
        text-align: center;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 8px;
        min-height: 44px; /* Minimum touch target height */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Add active state for touch devices */
    .main-header nav a:active {
        background-color: #555 !important;
        transform: scale(0.98);
    }

    /* Reduce section padding on mobile */
    .section-container {
        padding: 0 0.75rem;
    }

    /* Adjust post styles for mobile */
    .blog-page .post {
        padding: 1.25rem;
    }

    .blog-page .post h3 {
        font-size: 1.2rem;
    }

    /* Make sure content is readable on mobile */
    .post-content {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* Work gallery adjustments for mobile */
    .work-gallery {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Contact info adjustments for mobile */
    .contact-info {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Extra small devices (phones) */
@media (max-width: 480px) {
    .main-header nav {
        flex-direction: column;
        gap: 0.75rem;
    }

    .main-header nav a,
    .main-header nav a:link,
    .main-header nav a:visited {
        width: 100%;
        padding: 0.9rem 0;
    }
}

/* Add styling for inline images */
.inline-image {
    margin: 15px 0;
    max-width: 100%;
    overflow: hidden;
}

.insert-image-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 5px 10px;
    margin-right: 10px;
    border-radius: 3px;
    cursor: pointer;
}

.insert-image-btn:hover {
    background-color: #45a049;
}

/* Make all post images responsive */
.post-image img,
.post-content img,
.inline-image img,
.post-media img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Ensure post videos are also contained */
.post-video video,
.post-content video {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}