* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    display: inline-block;
    margin-right: 2rem;
    font-size: 1.5rem;
}

nav ul {
    list-style: none;
    display: inline-flex;
    gap: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

nav a:hover,
nav a.active {
    background-color: rgba(255,255,255,0.2);
}

/* Main Content */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 140px);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2rem 0;
    background: white;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hero h2 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 2rem;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Admin Section */
.admin-section {
    margin-bottom: 2rem;
}

.admin-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.admin-btn:hover {
    background: #218838;
}

.admin-panel {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-panel h3 {
    margin-bottom: 1rem;
    color: #667eea;
}

.admin-panel form {
    display: grid;
    gap: 1rem;
    max-width: 500px;
}

.admin-panel input,
.admin-panel textarea,
.admin-panel select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.admin-panel textarea {
    resize: vertical;
    min-height: 100px;
}

.admin-panel button[type="submit"] {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

.admin-panel button[type="submit"]:hover {
    background: #5a6fd8;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Announcements */
.announcements {
    margin-bottom: 2rem;
}

.announcements h2 {
    margin-bottom: 1rem;
    color: #667eea;
}

.announcements-list {
    display: grid;
    gap: 1rem;
}

.announcement {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}

.announcement.urgent {
    border-left-color: #dc3545;
}

.announcement.important {
    border-left-color: #ffc107;
}

.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.announcement-header h3 {
    color: #333;
    margin: 0;
}

.priority {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.priority.urgent {
    background: #dc3545;
    color: white;
}

.priority.important {
    background: #ffc107;
    color: #333;
}

.priority.normal {
    background: #28a745;
    color: white;
}

.date {
    color: #666;
    font-size: 0.9rem;
}

.announcement small {
    color: #666;
    font-style: italic;
    margin-top: 0.5rem;
    display: block;
}

/* Quick Links */
.quick-links h2 {
    margin-bottom: 1rem;
    color: #667eea;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.quick-link {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.quick-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.quick-link span {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.quick-link h3 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

/* Events */
.events-filter,
.marketplace-filters {
    margin-bottom: 2rem;
    text-align: center;
}

.filter-btn {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
    background: #667eea;
    color: white;
}

.events-list {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.event-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    gap: 1rem;
}

.event-date {
    background: #667eea;
    color: white;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    min-width: 80px;
    height: fit-content;
}

.event-date .day {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
}

.event-date .month {
    display: block;
    font-size: 0.9rem;
}

.event-details {
    flex: 1;
}

.event-details h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.event-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.event-actions {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-small {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
}

.btn-small:hover {
    background: #218838;
}

.interested-count {
    color: #666;
    font-size: 0.8rem;
}

.event-status.completed {
    color: #28a745;
    font-weight: bold;
}

.event-card.past {
    opacity: 0.7;
}

.event-card.past .event-date {
    background: #6c757d;
}

/* Calendar */
.event-calendar {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.event-calendar h3 {
    margin-bottom: 1rem;
    color: #667eea;
}

.calendar-grid {
    display: grid;
    gap: 0.5rem;
}

.calendar-item {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 3px solid #667eea;
}

/* Marketplace */
.marketplace-actions {
    margin-bottom: 2rem;
    text-align: center;
}

.primary-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

.primary-btn:hover {
    background: #5a6fd8;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #333;
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: #667eea;
}

.modal-content form {
    display: grid;
    gap: 1rem;
}

.modal-content input,
.modal-content textarea,
.modal-content select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.modal-content button[type="submit"] {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 5px;
    cursor: pointer;
}

/* Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.item-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.item-header h3 {
    color: #333;
    margin: 0;
    flex: 1;
}

.item-type {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
    margin-left: 0.5rem;
}

.item-type.sell {
    background: #28a745;
    color: white;
}

.item-type.rent {
    background: #17a2b8;
    color: white;
}

.item-type.buy {
    background: #ffc107;
    color: #333;
}

.item-type.free {
    background: #6f42c1;
    color: white;
}

.item-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 1rem;
}

.item-description {
    margin-bottom: 1rem;
    color: #666;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.item-contact {
    border-top: 1px solid #eee;
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.item-contact span {
    font-size: 0.9rem;
    color: #666;
}

.contact-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.contact-btn:hover {
    background: #5a6fd8;
}

/* Marketplace Rules */
.marketplace-rules {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.marketplace-rules h3 {
    margin-bottom: 1rem;
    color: #667eea;
}

.marketplace-rules ul {
    list-style-position: inside;
    color: #666;
}

.marketplace-rules li {
    margin-bottom: 0.5rem;
}

/* Contacts */
.emergency-contacts {
    margin-bottom: 2rem;
}

.emergency-contacts h2 {
    margin-bottom: 1rem;
    color: #dc3545;
}

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.contact-card:hover {
    transform: translateY(-5px);
}

.contact-card.urgent {
    border-top: 4px solid #dc3545;
}

.contact-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.contact-card h3 {
    margin-bottom: 1rem;
    color: #333;
}

.phone-number {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    color: #dc3545;
    text-decoration: none;
    margin-bottom: 0.5rem;
}

.phone-number:hover {
    text-decoration: underline;
}

/* Community Contacts */
.community-contacts,
.service-contacts,
.resident-directory {
    margin-bottom: 2rem;
}

.community-contacts h2,
.service-contacts h2,
.resident-directory h2 {
    margin-bottom: 1rem;
    color: #667eea;
}

.contacts-list {
    display: grid;
    gap: 1rem;
}

.contact-item {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info {
    flex: 1;
}

.contact-info h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.contact-details {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.contact-details span {
    color: #666;
    font-size: 0.9rem;
}

.contact-details a {
    color: #667eea;
    text-decoration: none;
}

.contact-details a:hover {
    text-decoration: underline;
}

.timing {
    color: #666;
    font-size: 0.8rem;
    font-style: italic;
}

/* Tabs */
.contacts-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-btn {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover,
.tab-btn.active {
    background: #667eea;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Guidelines */
.contact-guidelines,
.guidelines-grid {
    margin-bottom: 2rem;
}

.contact-guidelines h2 {
    margin-bottom: 1rem;
    color: #667eea;
}

.guidelines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.guideline-item {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.guideline-item h3 {
    margin-bottom: 0.5rem;
    color: #667eea;
}

.guideline-item p {
    color: #666;
    font-size: 0.9rem;
}

/* Footer */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    header h1 {
        display: block;
        margin-bottom: 1rem;
        text-align: center;
    }
    
    nav ul {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .page-header h2 {
        font-size: 1.5rem;
    }
    
    .event-card {
        flex-direction: column;
    }
    
    .event-date {
        align-self: flex-start;
    }
    
    .contact-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .item-type {
        margin-left: 0;
        align-self: flex-start;
    }
    
    .contacts-tabs {
        flex-wrap: wrap;
    }
    
    .contact-details {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .announcement-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.admin-form {
    max-width: 600px;
    margin: 2rem auto;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-form h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.admin-form label {
    display: block;
    margin-top: 1rem;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
    width: 100%;
    padding: 8px;
    margin-top: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.admin-form button {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    margin-top: 1rem;
    cursor: pointer;
}

.admin-form button:hover {
    background-color: #45a049;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    text-align: center;
    transition: background 0.3s ease;
}

.btn-green {
    background-color: #4CAF50;
}

.btn-green:hover {
    background-color: #388E3C;
}

.btn-red {
    background-color: #f44336;
}

.btn-red:hover {
    background-color: #c62828;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Adds space between title and nav */
    padding: 10px 20px;
}

header h1 {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between icon and text */
    font-size: 1.5rem;
}

nav ul {
    display: flex;
    gap: 30px; /* Space between menu items */
    list-style: none;
    margin: 0;
    padding: 0;
}

nav a {
    text-decoration: none;
    color: white;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 8px;
}

nav a.active {
    background-color: rgba(255, 255, 255, 0.2);
}