/* === General Body and Font Styles === */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    margin: 0;
    line-height: 1.5;
}

h1 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: #2c3e50;
}

/* === Site Header Styles === */
.site-header {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 1rem 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-header .logo-link {
    color: inherit;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
}

.site-header .logo-link i {
    margin-right: 10px;
    font-size: 1.4rem;
    color: #e74c3c;
}

.logout-link {
    color: inherit;
    text-decoration: none;
    font-size: 1rem;
    background-color: #e74c3c;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.logout-link:hover {
    background-color: #c0392b;
}

/* === Main Application Container === */
.container {
    flex: 1;
    max-width: 1200px;
    width: 95%;
    margin: 2rem auto;
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* === Two-Column Layout === */
.main-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.left-column {
    flex: 1;
    min-width: 320px;
}

.right-column {
    flex: 2;
    min-width: 320px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 1.5rem;
    background-color: #fdfdfd;
}

/* === Form Element Styles === */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label-heading {
    display: block;
    text-align: left;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #333;
}

fieldset.header-options {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

fieldset.header-options legend {
    font-weight: bold;
    color: #555;
    padding: 0 0.5rem;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

input[type="file"] {
    display: none;
}

.file-label {
    background-color: #007bff;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
    text-align: center;
}
.file-label:hover {
    background-color: #0056b3;
}

.file-label-small {
    background-color: #6c757d;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
    font-size: 0.9rem;
}
.file-label-small:hover {
    background-color: #5a6268;
}

.submit-button {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.submit-button:hover {
    background-color: #218838;
}

/* === Image Preview Styles === */
#logo-preview-container {
    margin-top: 15px;
    text-align: center;
}

#logo-preview {
    display: none;
    max-width: 200px;
    max-height: 80px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    background-color: #f9f9f9;
    object-fit: contain;
}

.dynamic-area, #previews-container {
    min-height: 200px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 1rem;
}

.preview-item {
    position: relative; /* This is essential for positioning the remove button */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 220px;
}

.preview-item img {
    width: 100%;
    height: 150px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid #eee;
}

.preview-item input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.9rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}


/* === NEW & IMPROVED: Remove Image Button === */
.remove-image-btn {
    position: absolute;
    top: -8px; /* Position it slightly outside the preview for a modern look */
    right: -8px;
    
    width: 28px;
    height: 28px;
    
    background-color: #34495e; /* Match footer color for consistency */
    color: #fff;
    border: 2px solid #fff; /* White border to lift it off the image */
    border-radius: 50%; /* Perfect circle */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Add depth */
    
    display: flex;
    justify-content: center;
    align-items: center;
    
    font-size: 16px;
    font-weight: bold;
    line-height: 1; /* Ensure the 'x' is centered */
    
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    z-index: 10; /* Ensure it's on top of the image */
}

.remove-image-btn:hover {
    background-color: #e74c3c; /* Red hover for clear destructive action */
    transform: scale(1.15) rotate(90deg); /* Animate size and rotation */
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}


/* === Site Footer Styles === */
.site-footer {
    background-color: #34495e;
    color: #bdc3c7;
    padding: 2rem 1rem;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    gap: 2rem;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h3 {
    color: #ecf0f1;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.footer-section p i {
    color: #e74c3c;
}

.footer-section a {
    color: inherit;
    text-decoration: none;
}
.footer-section a:hover {
    text-decoration: underline;
    color: #3498db;
}

.social-links a {
    color: #bdc3c7;
    margin: 0 10px;
    font-size: 1.8rem;
    transition: color 0.3s ease;
}
.social-links a:hover {
    color: #3498db;
    text-decoration: none; /* Override general link hover for icons */
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid #7f8c8d;
    font-size: 0.9rem;
}


/* === Login Page Specific Styles === */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background-color: transparent;
    box-shadow: none;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: #fff;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.1);
    text-align: center;
}

.login-box h1 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    margin-bottom: 2rem;
    color: #666;
}

.login-error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
    text-align: left;
}

.login-box .input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.login-box .input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    transition: color 0.3s ease;
}

.input-wrapper input:focus + i {
    color: #007bff;
}

.input-wrapper input {
    padding-left: 45px !important; 
}

.form-options {
    text-align: right;
    margin-bottom: 1.5rem;
}

.forgot-password {
    font-size: 0.9rem;
    color: #007bff;
    text-decoration: none;
}
.forgot-password:hover {
    text-decoration: underline;
}

.login-button {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: bold;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.login-button:hover {
    background-color: #0056b3;
}

.signup-link {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #666;
}

.signup-link a {
    color: #007bff;
    font-weight: bold;
    text-decoration: none;
}
.signup-link a:hover {
    text-decoration: underline;
}


/* === Responsive Design === */
@media (max-width: 768px) {
    .main-layout, .footer-content {
        flex-direction: column; /* Stack columns vertically */
    }

    .footer-content {
        text-align: center;
    }

    .footer-section h3 {
        display: block; /* Make heading border full-width */
    }
}