:root {
    --primary-color: #4F46E5; /* Indigo */
    --secondary-color: #10B981; /* Emerald */
    --dark-color: #111827;
    --light-bg: #F3F4F6;
    --font-family: 'Sarabun', sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--light-bg);
    color: var(--dark-color);
}

.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, #312E81 100%) !important;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 8px;
    font-weight: 500;
}

.btn-primary:hover {
    background-color: #4338CA;
    border-color: #4338CA;
}

.table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.table thead {
    background-color: #F9FAFB;
}

.badge {
    padding: 0.45em 0.8em;
    border-radius: 6px;
    font-weight: 500;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100%;
    text-align: left;
    display: inline-block;
    line-height: 1.45;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Specific styling */
.hero-section {
    background: linear-gradient(rgba(17, 24, 39, 0.75), rgba(17, 24, 39, 0.75)), url('https://images.unsplash.com/photo-1577896851231-70ef18881754?q=80&w=2070&auto=format&fit=crop') center/cover;
    color: white;
    border-radius: 12px;
    padding: 3.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hero-title {
    font-size: clamp(1.4rem, 4.5vw, 2.5rem);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.navbar-brand {
    white-space: normal !important;
    word-break: break-word;
    font-size: 1.05rem;
    line-height: 1.25;
}

.event-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Prevent Horizontal Scroll / Overflow on Mobile & Force Text Wrapping */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body, h1, h2, h3, h4, h5, h6, p, div, span, label, td, th, a, input, select, textarea {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Flexbox overflow fix: allow child elements to shrink and wrap */
.d-flex > *, .row > * {
    min-width: 0;
}

/* Form selects: ensure text doesn't overflow container */
select.form-select, .form-select {
    max-width: 100%;
    white-space: normal !important;
    word-break: break-word !important;
    text-overflow: ellipsis;
}

select.form-select option {
    white-space: normal;
    word-break: break-word;
}

/* Table cells text wrapping */
.table td, .table th {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Responsive badges container */
.badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    max-width: 100%;
}

/* Mobile responsive media queries */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 0.9rem !important;
        line-height: 1.2;
    }
    .hero-section {
        padding: 2rem 1rem;
        border-radius: 8px;
        margin-bottom: 1.5rem;
    }
    .hero-title {
        font-size: 1.3rem;
    }
    .hero-section .lead {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 1.25rem;
    }
    .hero-section .btn {
        width: 100%;
        font-size: 0.95rem;
    }
    h1, h2, h3, h4, h5, h6, p, div {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    .table-responsive {
        border-radius: 8px;
        -webkit-overflow-scrolling: touch;
    }
    .table th, .table td {
        padding: 0.6rem 0.5rem;
        font-size: 0.85rem;
    }
    .table th {
        white-space: nowrap;
    }
}
