/* General Body and Container Styles */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}

.container {
    padding: 20px;
    max-width: 1200px;
    margin: 20px auto; /* Added top/bottom margin */
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* Slightly adjusted shadow */
}

/* Header Controls (Clan Info, Nav, Actions) */
.header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 20px; /* Adjusted padding */
    background-color: #e9ecef;
    border-bottom: 1px solid #dee2e6;
}

/* New styles for clan badge and name layout */
.clan-identity-container {
    display: flex;
    flex-direction: column; /* Stack image and text vertically */
    align-items: center;   /* Center items horizontally */
    margin-right: 20px;    /* Spacing from the nav */
}

.clan-badge {
    height: 100px; /* Adjust size as needed */
    width: auto;
    margin-bottom: 5px; /* Space between badge and name */
}

.header-controls .clan-info {
    font-weight: bold;
    font-size: 1.1em;
    text-align: center; /* Ensure text itself is centered if it wraps */
    /* margin-right: 20px; Removed as it's now handled by clan-identity-container */
    margin-top: 0; /* Adjust if needed */
}

.header-controls nav {
    flex-grow: 1; /* Allow nav to take available space */
}

nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    background-color: #333; /* Base color for nav background */
    overflow: hidden; /* Clear floats */
    display: flex; /* Use flexbox for easier alignment */
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
}

nav ul li {
    /* float: left; no longer needed with flexbox */
}

nav ul li a,
nav ul li button {
    display: block;
    color: white;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    background-color: #007bff; /* Default button/link color */
    border: none;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: inherit; /* Inherit font size from parent */
    transition: background-color 0.3s ease; /* Smooth transition */
}

nav ul li a:hover,
nav ul li button:hover {
    background-color: #0056b3; /* Darker shade on hover */
}

/* Specific button in nav (e.g., Clear Cache) */
nav ul li button#clearCacheBtn {
    background-color: #17a2b8; /* Info color for clear cache */
}
nav ul li button#clearCacheBtn:hover {
    background-color: #138496; /* Darker info */
}


.header-controls .actions {
    margin-left: 20px; /* Added margin for spacing */
}
.header-controls .actions form {
    margin: 0; /* Remove default form margin */
}

.header-controls .actions .change-clan-btn {
    background-color: #dc3545; /* Red for destructive/logout action */
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.header-controls .actions .change-clan-btn:hover {
    background-color: #c82333; /* Darker red on hover */
}

/* Flash Messages */
.flashes {
    list-style-type: none;
    padding: 0;
    margin-bottom: 15px;
}

.flashes li {
    padding: 10px 15px; /* Adjusted padding */
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid transparent; /* Base border */
}

.flashes li.error { background-color: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.flashes li.success { background-color: #d4edda; color: #155724; border-color: #c3e6cb; }
.flashes li.info { background-color: #d1ecf1; color: #0c5460; border-color: #bee5eb; }

/* Dynamic Content Styles (Loading, Error, Data Display) */
.loading-message,
.error-message-dynamic {
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 4px;
    text-align: center;
}

.loading-message { background-color: #e9ecef; color: #495057; }
.error-message-dynamic { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

img.data-image {
    display: none; /* Initially hidden, shown by JS */
    max-width: 100%;
    width: 500px;
    height: auto; /* Maintain aspect ratio */
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 4px; /* Added border-radius */
}

pre.data-output {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 15px;
    border-radius: 4px;
    white-space: pre-wrap; /* Wraps long lines */
    word-wrap: break-word; /* Breaks long words */
    font-size: 0.9em; /* Slightly smaller font for pre */
    max-height: 500px; /* Added max-height for long outputs */
    overflow-y: auto; /* Scroll for overflow */
}

/* Table Styles (from members.html, can be generalized) */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th, table td {
    padding: 4px;
    text-align: left;
}

table th {
    background-color: #f2f2f2;
    font-weight: bold;
    cursor: pointer; /* Indicate headers are clickable */
}

table th span { /* For sort indicators */
    font-size: 0.8em;
}

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tr:hover {
    background-color: #f1f1f1;
}

table img { /* For TH images in tables */
    height: 30px;
    vertical-align: middle;
}

/* Button styles (general .btn class from index.html) */
.btn {
    display: inline-block;
    padding: 8px 15px;
    margin: 5px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.btn:hover {
    background-color: #0056b3;
}

/* Search form styles (from index.html & stats.html) */
.search-form input[type="text"] {
    padding: 8px;
    margin-right: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Dashboard card styles (from index.html) */
.dashboard {
    text-align: center;
}
.command-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px; /* Spacing between cards */
    margin-top: 20px;
}
.command-card {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    width: 250px; /* Adjust as needed */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.command-card h3 {
    margin-top: 0;
}
.command-card .sub-commands .btn {
    display: block; /* Make sub-command buttons stack */
    margin-top: 10px;
}