/* Basic reset for consistent styling */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ================== */
/* === GLOBAL STYLING === */
/* ================== */
:root {
    /* Define colors once using CSS custom properties (variables) */
    --primary-color: #a52a2a; /* Main brand color (Deep Red/Brown) */
    --primary-dark: #7b1d1d; /* Darker version for hover states */
    --text-color: #333; /* Main text color */
    --text-light: #666; /* Lighter text for descriptions */
    --bg-light: #fcf3c6; /* Light off-white background */
    --bg-header: #fcf3c6; /* Header background color */
    --border-color: #704214; /* Border color (Dark Brown) */
    --accent-color: #c47a39; /* Mid-tone accent (Leather/Saddle) */

    /* Typography */
    --font-family-primary: 'Segoe UI', 'Helvetica Neue', sans-serif;
    --font-size-body: 1rem;
}

body {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-body);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-light); 
}

/* =============================================== */
/* === HEADER (Styling kept as is - it's great!) === */
/* =============================================== */
.main-header {
    background: linear-gradient(to bottom, #d9b77c, #b68a54);
    border-bottom: 4px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo img {
    height: 75px;
    filter: sepia(40%);
}

/* Navigation */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    text-decoration: none;
    color: #3a2d1f;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 1px;
    position: relative;
    transition: color 0.3s ease;
}

.main-nav a::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    background: var(--border-color);
    bottom: -4px;
    left: 0;
    transition: width 0.3s ease;
}

.main-nav a:hover {
    color: #b66a32;
}

.main-nav a:hover::after {
    width: 100%;
}

/* Header Button */
.order-button {
    background: linear-gradient(45deg, var(--primary-dark), var(--primary-color));
    color: #fffaf0;
    text-transform: uppercase;
    padding: 0.75rem 1.5rem;
    font-weight: 800;
    border-radius: 30px;
    letter-spacing: 1px;
    text-decoration: none;
    box-shadow: 0 0 10px rgba(107, 63, 17, 0.4);
    transition: all 0.3s ease;
}

.order-button:hover {
    background: linear-gradient(45deg, #a05922, #b66a32);
    transform: scale(1.05);
}

/* ====================================================================================== */
/* === CONTENT WRAPPER & HEADINGS === */
/* ====================================================================================== */

.container {
    max-width: 1100px; /* Slightly smaller for cleaner admin area */
    margin: 40px auto;
    padding: 30px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
}

h2 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-top: 30px;
    margin-bottom: 15px;
    border-left: 5px solid var(--accent-color);
    padding-left: 10px;
}

hr {
    border: none;
    border-top: 1px dashed var(--border-color);
    margin: 30px 0;
}

/* ====================================================================================== */
/* === MESSAGE ALERT === */
/* ====================================================================================== */
.message {
    text-align: center;
    padding: 12px;
    margin-bottom: 20px;
    background-color: #fff3cd; /* Light warning color */
    color: #856404; /* Dark warning text */
    border: 1px solid #ffeeba;
    border-radius: 4px;
    font-weight: bold;
}


/* ====================================================================================== */
/* === UPLOAD FORM === */
/* ====================================================================================== */
.upload-form {
    text-align: center;
    padding: 20px 0;
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-top: 20px;
}

.upload-form h2 {
    text-align: center;
    border-left: none;
    padding-left: 0;
    margin-top: 0;
    color: var(--text-light);
}

.upload-form form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
}

#photo-input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

.upload-form button[type="submit"] {
    background-color: var(--accent-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.upload-form button[type="submit"]:hover {
    background-color: #a05922; /* Darker accent */
    transform: translateY(-1px);
}

/* ====================================================================================== */
/* === PHOTO GRID DISPLAY === */
/* ====================================================================================== */
.photo-grid {
    display: grid;
    /* This creates 4 equally sized columns */
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px; /* Increased gap for better visual separation */
    margin-top: 20px;
}

.photo-item {
    overflow: hidden; 
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    /* Subtle hover effect */
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.photo-item:hover {
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-4px);
}

.photo-item img {
    /* Make the image fill its container */
    width: 100%; 
    /* Fixed height for uniformity in the grid */
    height: 180px; 
    /* Ensures the image covers the area without distortion */
    object-fit: cover; 
    display: block;
}

/* ====================================================================================== */
/* === RESPONSIVE DESIGN (MATCHING PHOTO EDITOR HEADER) === */
/* ====================================================================================== */

/* Tablet/Small Desktop */
@media (max-width: 1024px) {
    .header-container {
        padding: 1rem;
    }
}

/* Tablet/Mobile (768px and below) - HIDE NAV to match Photo Editor */
@media (max-width: 768px) {
    /* !!! HIDES the navigation to match the Photo Editor CSS !!! */
    .main-nav { 
        display: none; 
    }
    
    /* Ensures Logo and Button remain on the same row, as no Nav is present */
    .header-container {
        flex-direction: row; 
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.5rem;
    }

    /* NOTE: If you used the `.header-top-bar` wrapper, you should remove it 
       from your HTML when using this responsive CSS. */
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    /* Header adjustments to match photo editor */
    .logo img {
        height: 50px; 
    }
    .order-button {
        padding: 0.6rem 1rem; 
        font-size: 0.9rem;
    }
}