/* static/style.css */
:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --background-color: #f8f9fa;
    --surface-color: #ffffff;
    --text-color: #343a40;
    --border-color: #dee2e6;
    --shadow: 0 2px 5px rgba(0,0,0,0.07);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
}

.container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--surface-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

nav {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 0 1rem;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-brand {
    font-weight: bold;
}

nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

nav a:hover {
    background-color: var(--primary-color);
    color: white;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

h1 {
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Forms */
form { display: flex; flex-direction: column; gap: 1.25rem; max-width: 500px; }
.form-group, .form-actions { display: flex; flex-direction: column; }
label { margin-bottom: 0.5rem; font-weight: 500; }
input[type="text"], input[type="password"] {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="number"], select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    background-color: white;
}
input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}
button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    align-self: flex-start;
    transition: background-color 0.2s;
}
button:hover { background-color: var(--primary-hover); }

.button-danger {
    background-color: #dc3545;
}
.button-danger:hover {
    background-color: #c82333;
}
.button-secondary {
    background-color: #6c757d;
}
.button-secondary:hover {
    background-color: #5a6268;
}
.button-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    background-color: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 0.9rem;
}
.button-link-secondary {
    composes: button-link;
    background-color: #6c757d;
}
.db-admin-form {
    max-width: none; /* Allow form to take full width */
}
.button-small {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}


/* Tables */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 1.5rem; }
th, td { padding: 0.8rem 1rem; text-align: left; border-bottom: 1px solid var(--border-color); }
thead th { background-color: var(--background-color); font-weight: 600; }
tbody tr:hover { background-color: #f1f1f1; }

.actions form {
    margin: 0;
    flex-direction: row;
    padding: 0;
}

/* Flash Messages */
.flashes { list-style: none; padding: 0; margin-bottom: 1.5rem; }
.alert { padding: 1rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: 4px; }
.alert-success { color: #155724; background-color: #d4edda; border-color: #c3e6cb; }
.alert-danger { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }
.alert-warning { color: #856404; background-color: #fff3cd; border-color: #ffeeba; }
.alert-info { color: #0c5460; background-color: #d1ecf1; border-color: #bee5eb; }

/* Management Page */
.management-section {
    margin-top: 2.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}


/* Raffle Page */
.raffle-results {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
    margin: 2rem 0;
}
.raffle-card {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem 2rem;
    text-align: center;
    flex-grow: 1;
}
.raffle-card h2 {
    margin-top: 0;
    border-bottom: none;
}
.raffle-name {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}
.raffle-actions { display: flex; gap: 1rem; margin-top: 1.5rem; }

/* Homepage Styles */
.home-content {
    text-align: center;
}

.home-image {
    max-width: 80%;
    height: auto;
    margin: 1rem 0 2rem 0;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* Admin GUI Styles */
.breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}
.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}
.dynamic-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}
.inline-edit {
    width: 100%;
    box-sizing: border-box;
}
/* Mobile Navigation Toggle (Hamburger) */
.mobile-nav-toggle { display: none; }

/* Responsive table for mobile */
@media screen and (max-width: 768px) {
    table, thead, tbody, th, td, tr { display: block; }
    thead tr { position: absolute; top: -9999px; left: -9999px; }
    tr { border: 1px solid #ccc; margin-bottom: 1rem; }
    td { border: none; border-bottom: 1px solid #eee; position: relative; padding-left: 50%; min-height: 30px; }
    td:before { position: absolute; top: 6px; left: 6px; width: 45%; padding-right: 10px; white-space: nowrap; content: attr(data-label); font-weight: bold; }
    .actions {
        display: flex;
        gap: 0.5rem;
    }
    .raffle-results {
        flex-direction: column;
    }

    .container {
        padding: 1rem;
        margin-top: 1rem;
    }

    /* Hamburger Menu Styles */
    .mobile-nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 25px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001; /* Above the nav panel */
    }

    .mobile-nav-toggle span {
        width: 30px;
        height: 3px;
        background: var(--text-color);
        border-radius: 10px;
        transition: all 0.3s linear;
    }

    .main-nav {
        display: none; /* Hide by default on mobile */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        background-color: var(--surface-color);
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        z-index: 1000;
    }

    .main-nav.active {
        display: flex; /* Show when active */
    }

    /* Hide dropdowns on mobile, show as plain links */
    .main-nav .dropdown { display: contents; }
    .main-nav .dropbtn { display: none; }
    .main-nav .dropdown-content {
        display: contents;
    }
    .main-nav .dropdown-content a {
        padding: 0;
        color: var(--primary-color);
    }
}

    background-color: #6c757d;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    /* Style the button to look like the other nav links */
    background-color: transparent;
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    font-size: 1em; /* Match nav a font-size */
    font-weight: 500; /* Match nav a font-weight */
    border: none;
    cursor: pointer;
    font-family: inherit; /* Inherit font from body */
    border-radius: 5px;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.dropdown:hover .dropbtn {
    background-color: var(--primary-color);
    color: white;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 5px;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
    color: var(--primary-color);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Tables */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 1.5rem; }

button:hover { background-color: var(--primary-hover); }

.button-danger {
    background-color: #dc3545;
}
.button-danger:hover {
    background-color: #c82333;
}
.button-secondary {
    background-color: #6c757d;
