/* === Base Reset and General Styles === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Noto Sans Sinhala', sans-serif;
    background-color: #f9fafb; /* Light gray background */
    color: #333; /* Dark gray text */
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
    border-radius: 0.5rem;
}

/* === Layout === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

main {
    flex: 1;
}

/* === Utility Containers === */
.full-view-ad-btn-container {
    text-align: center;
    margin-top: -2rem; 
    margin-bottom: 2rem;
}

/* === Hero Section === */
.install-button {
    margin-top: 1rem;
    cursor: pointer;
    background-color: #075e54;
    color: white;
    border: none;
}

.hero-section {
    position: relative;
    background: linear-gradient(135deg, #075e54, #128c7e);
    color: #fff;
    padding: 4rem 2rem;
    border-radius: 1rem;
    text-align: center;
    margin-bottom: 3rem;
    line-height: 1.2;
    overflow: hidden;
}

.hero-section canvas#ripple-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none;
    display: block;
    z-index: 0;
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-section .tagline {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

/* === Buttons === */
.btn-primary-modern,
.btn-secondary-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none; /* Added for anchor tags */
}

.btn-primary-modern {
    background: #fff;
    color: #075e54;
}

.btn-primary-modern:hover {
    background: #e2e8f0;
}

.btn-secondary-modern {
    background: transparent;
    color: #075e54;  
    border: 2px solid #075e54; 
}

.btn-secondary-modern:hover {
    background: #075e54; 
    color: #fff;
    border-color: #075e54; 
}

/* === Sections === */
.section-block {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-icon {
    color: #075e54;
}

/* === Cards and Layouts === */
.card-modern {
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* === Item Grid (for Ads) === */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.item-card-modern {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.item-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.item-image-wrapper {
    overflow: hidden;
    height: 200px;
}

.item-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.item-card-modern:hover .item-image-wrapper img {
    transform: scale(1.05);
}

.item-content {
    padding: 1rem;
}

.item-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.item-description {
    font-size: 0.95rem;
    color: #555;
}

.section-footer-actions {
    margin-top: 2rem;
    text-align: center;
}

/* === Category Grid (Used for both Categories and Services) === */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.category-item-modern {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    padding: 1.2rem;
    border-radius: 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
}

.category-item-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.service-img {
    height: 50px; 
    width: auto; 
    margin: 0.5rem auto 0.5rem; 
    border-radius: 0; 
}

.icon-large {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #075e54;
}

.category-item-modern span {
    font-weight: 500;
    font-size: 0.95rem;
}

/* -------------------------------------------------------------------
| LOST & FOUND PAGE HEADER LAYOUT (NEWLY ADDED FLEXBOX LOGIC)
* ------------------------------------------------------------------- */

.page-header-wrapper {
    display: flex;
    flex-direction: column; /* Default: column for mobile */
    margin-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 1rem;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0.5rem;
}

.header-brand {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #128c7e;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    text-decoration: none;
}

.page-title {
    font-size: 2rem;
    color: #075e54;
    text-align: left; 
    margin: 1rem 0 0;
    width: 100%;
    display: flex; 
    align-items: center;
    gap: 0.5rem;
}

/* Back Button (Secondary Action) - LIGHT BLUE STYLE */
.btn-back {
    display: none; /* Hidden by default on mobile */
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    font-weight: 500;
    border-radius: 50px;
    transition: all 0.2s ease;

    /* LIGHT BLUE STYLING */
    border: 2px solid #00bcd4; 
    color: #00bcd4;          
    background: #e0f7fa;     
    text-decoration: none;
}

.btn-back:hover {
    background: #b2ebf2;     
    color: #008ba3;           
    border-color: #008ba3;   
}

.page-actions {
    display: none; /* Hidden on mobile, shown on desktop */
    gap: 1rem;
}
.page-actions-mobile {
    display: flex; /* Shown on mobile, hidden on desktop */
}

/* Message Styling */
.server-message {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
}
.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* -------------------------------------------------------------------
| LOST & FOUND CARD STYLES (Should ideally be in lost_and_found_styles.css)
| NOTE: Keeping these here to satisfy "full code" request, 
|       but recommend moving them. They are currently overwritten by 
|       lost_and_found_styles.css (if linked after this file).
* ------------------------------------------------------------------- */
.lost-and-found-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.lost-and-found-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lost-and-found-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.lost-and-found-card .item-title {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.lost-and-found-card .item-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.lost-and-found-card .meta-info {
    font-size: 0.8rem;
    color: #888;
    display: flex;
    justify-content: space-between;
}

/* === Footer === */
footer {
    background: #1f2937;
    color: #fff;
    text-align: center;
    padding: 2rem 1rem;
}

footer p {
    font-size: 0.9rem;
}

/* === Misc === */
.highlight-text {
    font-weight: 700;
    color: #fff;
}

.empty-state-message {
    text-align: center;
    color: #999;
    font-size: 1rem;
}

.error-state {
    color: red;
}

/* === Mobile Adjustments (Screen width overrides) === */
@media (max-width: 768px) {
    .item-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-section h1 {
        font-size: 2rem;
    }
    .hero-section .tagline {
        font-size: 1rem;
    }
    .section-title {
        font-size: 1.5rem;
    }
    .item-title {
        font-size: 1rem;
    }
    .item-description {
        font-size: 0.9rem;
    }
    .btn-primary-modern,
    .btn-secondary-modern {
        font-size: 0.95rem;
        padding: 0.65rem 1.2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    .hero-section {
        padding: 3rem 1rem;
    }
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    .btn-primary-modern,
    .btn-secondary-modern {
        width: 100%;
        justify-content: center;
    }
}

/* -------------------------------------------------------------------
| DESKTOP LAYOUT (Final Overrides for screens wider than 769px)
* ------------------------------------------------------------------- */
@media (min-width: 769px) {
    .page-header-wrapper {
        flex-direction: row; /* Switches to row layout */
        align-items: center;
        flex-wrap: nowrap;
        justify-content: space-between;  
    }
    
    .header-top-row {
        display: none; /* Hide the mobile top bar */
    }
    
    .btn-back {
        display: flex; /* Show the light blue back button on desktop */
        order: 1; /* Position: Left */
    }
    
    .page-title {
        text-align: center;
        flex-grow: 1; 
        order: 2; /* Position: Center */
        margin: 0;
        font-size: 2rem;
    }
    
    .page-actions {
        display: flex; /* Show the desktop actions group (Post/Login) */
        order: 3; /* Position: Right */
    }
    .page-actions-mobile {
        display: none; /* Hide mobile actions */
    }
}