body {
    font-family: 'Open Sans', Arial, sans-serif; /* Modern font */
    background: #f0f7f0;
    color: #333;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

header {
    background: linear-gradient(to bottom, #006400, #004d00); /* Subtle gradient for depth */
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    position: relative;
    border-radius: 6px;
}

header h1 {
    margin: 0;
    font-size: 2.4em;
    font-weight: 700;
}

h2 {
    color: #006400;
    margin: 30px 0 20px;
}

/* Centered content wrapper - use on most pages for consistency */
.content-wrapper {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    text-align: center;
}

/* Optional: tighter for forms */
.form-wrapper {
    max-width: 600px;
    margin: 40px auto;
    text-align: center;
}

button {
    background: #006400;
    color: white;
    border: none;
    padding: 10px 24px;
    font-size: 1.8em;
    border-radius: 6px;
    cursor: pointer;
    margin: 10px;
}

button:hover {
    background: #004d00;
}

a {
    color: #006400;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}



nav {
    background: #004d00;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    flex-wrap: nowrap;
    gap: 12px;
    border-radius: 6px;
}

.tourney-brand {


    flex: 1 1 auto;
    text-align: center;
    white-space: nowrap;
    overflow: hidden; 
    text-shadow: 0 3px 10px rgba(0,0,0,0.75);
}

.tourney-brand a {
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 4.0em;
}

.tourney-brand a:hover {
    text-decoration: underline;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Avatar & trigger */

.user-avatar {
    width: 48px;
    height: 48px;
    min-width: 48px;           /* â† prevents horizontal squash */
    min-height: 48px;
    border-radius: 50%;
    background: #d4af37;
    color: #1a3c1a;
    font-weight: bold;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #fffde7;
    box-shadow: 0 3px 10px rgba(0,0,0,0.5);
    transition: transform 0.15s ease;
    overflow: hidden;
    flex-shrink: 0;            /* â† stops nav from compressing it */
}





.user-avatar:hover {
    transform: scale(1.05);
}

.initials {
    color: white;
    font-weight: bold;
    font-size: 1.2em;
}


.menu-trigger {
    background: transparent;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    transition: background 0.2s;
}



.menu-trigger:hover {
    background: rgba(255,255,255,0.25);
}

/* Dropdown */
.user-dropdown {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    min-width: 220px;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 14px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
}

.user-dropdown a:hover {
    background: #f0f7f0;
}

.dropdown-header {
    padding: 14px 20px;
    background: #006400;
    color: white;
    font-weight: 600;
    text-align: center;
}

.dropdown-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 0;
}

.logout-item,
.login-item {
    color: #B22222;
    font-weight: 600;
}


@media (max-width: 768px) {
    nav {
        padding: 10px 12px;
        gap: 10px;
    }

    .tourney-brand a {
        font-size: 1.5em;
    }

    .user-area {
        justify-content: flex-end;  /* keeps it right-aligned */
    }

    .menu-trigger,
    .user-avatar {
        padding: 10px 14px;
        min-width: 60px;
        min-height: 48px;
    }

    .initials {
        font-size: 1.25em;
    }

    .user-dropdown {
        position: fixed;
        top: 56px;
        left: 8px;
        right: 8px;
        width: auto;
        min-width: unset;
        max-height: 80vh;
        overflow-y: auto;
        border-radius: 12px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    }
}






    .user-dropdown.show {
        display: block;
    }

    /* Bigger tap targets inside dropdown */
    .user-dropdown a,
    .dropdown-header {
        padding: 16px 24px;
        font-size: 1.1em;
    }
}

/* Forms */
form label {
    display: block;
    margin: 15px 0 5px;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="file"] {
    padding: 10px;
    width: 100%;
    max-width: 400px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Slideshow */
.slideshow-container {
    max-width: 800px;
    margin: auto;
    position: relative;
}

.slide {
    display: none;
    width: 100%;
}

.slide.active {
    display: block;
}

.slide img {
    width: 100%;
    border-radius: 8px;
}

/* Photo preview in tables */
.photo-preview {
    max-width: 80px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Better breathing room for text on mobile */
@media (max-width: 768px) {



.user-avatar {
        width: 44px !important;     /* slightly smaller helps on tiny screens */
        height: 44px !important;
        min-width: 44px;
        min-height: 44px;
        font-size: 1.1rem;          /* initials still fit nicely */
        border-width: 2px;
        flex: 0 0 44px;
    }    

body {
        padding-left: 15px;
        padding-right: 15px;
        box-sizing: border-box;
    }
    div[style*="text-align:center"],
    p,
    ul,
    ol,
    h2,
    h3 {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    font-size: 0.9em;
    color: #666;
    background: #f0f7f0;
    border-top: 1px solid #ccc;
}

/* Back link consistency */
.back-link {
    text-align: center;
    margin-top: 40px;
}

/* Make header title stay on one line on mobile */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.1em;
        line-height: 1.2;
    }
}

/* Extra utility classes used across pages */
.empty {
    color: #777;
    font-style: italic;
    margin: 30px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: #f0f7f0;
    color: #006400;
    font-weight: 600;
}

.actions a,
.actions button {
    margin: 0 8px;
}

.delete-btn {
    background: #B22222;
}

.delete-btn:hover {
    background: #8B1A1A;
}



@media (max-width: 768px) {
    .user-area {
        flex: 0 0 auto;           /* prevent stretching */
    }
    
    .menu-trigger {
        display: inline-flex;     /* better centering */
        align-items: center;
        justify-content: center;
        min-width: 40px;          /* give it breathing room */
        text-align: center;
        padding: 8px 16px;        /* balanced touch target */
        margin: 0 auto;           /* center if needed */
        font-size: 1.1em;         /* readable on phone */
    }
    
    .user-dropdown {
        right: 0;                 /* ensure dropdown aligns to right edge */
        left: auto;
        min-width: 200px;         /* prevent it from being too narrow */
    }
}
