/* =========================================================
   BASE STYLES & TYPOGRAPHY
   ========================================================= */
:root {
    --primary-color: #007bff; /* Deep Blue Accent */
    --accent-color: #ffc107;  /* Gold/Yellow for Ratings */
    --bg-light: #f0f2f5;      /* Very Light Gray Background */
    --bg-white: #ffffff;
    --text-dark: #343a40;
    --border-color: #e9ecef;
    --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    min-width: 320px; /* Prevents layout issues on very small screens */
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* FIX 1: Maximize System View Width */
.container {
    width: 100%; /* Uses full width */
    max-width: 1600px; /* Optional cap, but allows very wide screens to be used */
    margin: 30px auto;
    padding: 0 15px; /* Maintain padding on the inside */
}

/* =========================================================
   HEADER & NAVIGATION
   ========================================================= */
.header {
    background: var(--primary-color);
    color: white;
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.header a {
    color: var(--accent-color);
}

/* =========================================================
   LAYOUTS (Main & Side)
   ========================================================= */
.main-layout {
    display: flex;
    gap: 30px;
}

.sidebar {
    flex: 0 0 280px; 
    background: var(--bg-white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.main-content {
    flex-grow: 1;
}

.district-list h3 {
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.district-list a {
    display: block;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 5px;
    background: var(--bg-light);
    color: var(--text-dark);
    font-weight: 500;
}

.district-list a:hover {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
}

/* =========================================================
   HOME/PLACE CARD STYLE
   ========================================================= */
.place-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.place-card {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.place-card:hover {
    transform: translateY(-5px);
}

.place-card img {
    width: 100%;
    height: 200px; 
    object-fit: cover;
    display: block;
}

.card-content {
    padding: 15px 20px;
}

.card-content h3 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 1.5rem;
}

.rating {
    color: var(--accent-color);
    font-size: 1.2rem;
}
.rating .avg-text {
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: bold;
    margin-left: 5px;
}

/* =========================================================
   FORM / ALERT / UTILITY STYLES
   ========================================================= */
.card {
    background-color: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    padding: 30px;
    margin: 20px auto;
    max-width: 600px;
}
.form-group {
    margin-bottom: 20px;
}
input[type="text"], input[type="email"], input[type="password"], textarea, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
}
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}
.btn.primary {
    background-color: var(--primary-color);
    color: white;
}
.btn.success {
    background-color: #28a745;
    color: white;
}
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    border: 1px solid transparent;
}
.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}
.alert.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

/* =========================================================
   FIX 2: MOBILE RESPONSIVE STYLES (Better Mobile View)
   ========================================================= */
@media (max-width: 992px) {
    /* Main Layout: Stack sidebar and content */
    .main-layout {
        flex-direction: column;
        gap: 20px; /* Reduce gap on mobile */
    }

    /* Sidebar: Make full width and static */
    .sidebar {
        width: 100%;
        position: static;
        top: 0;
        border-radius: 0 0 12px 12px; /* Nicer rounding at bottom */
    }
    
    /* Place Grid: Allow cards to collapse nicely */
    .place-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)); /* Single column on phone */
        gap: 15px; /* Reduced space between cards */
    }

    /* Cards: Ensure full width */
    .place-card {
        width: 100%;
        margin: 0;
    }
    
    /* Headers and Text */
    .header h1 {
        font-size: 1.8rem;
    }

    /* Forms (Login/Submit/Register) */
    .card {
        padding: 20px; /* Reduced internal padding */
        width: 95%;
    }
}