/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    font-size: 14pt;
}

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

/* Header */
header {
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

header h1 {
    font-size: 2em;
    font-weight: 600;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.username {
    color: #ecf0f1;
    font-size: 1em;
}

.logout-btn {
    color: #ecf0f1;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    background-color: #34495e;
    transition: background-color 0.2s;
    font-weight: 500;
}

.logout-btn:hover {
    background-color: #e74c3c;
}

nav {
    margin-top: 0;
}

nav a {
    color: #ecf0f1;
    text-decoration: none;
    margin-right: 20px;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

nav a:hover {
    background-color: #34495e;
}

nav a.active {
    background-color: #3498db;
    font-weight: 600;
}

/* Tables */
table {
    width: 100%;
    background-color: white;
    border-collapse: collapse;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    font-size: 10pt;
}

th {
    background-color: #3498db;
    color: white;
    padding: 10px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 8px 10px;
    border-bottom: 1px solid #ecf0f1;
}

tr:hover {
    background-color: #f8f9fa;
}

tr:last-child td {
    border-bottom: none;
}

/* Sticky Header */
.sticky-header th {
    position: sticky;
    top: 0;
    background-color: #3498db;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Cards */
.card {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.card ul {
    list-style: none;
}

.card li {
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
}

.card li:last-child {
    border-bottom: none;
}

.card a {
    color: #3498db;
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.2s;
}

.card a:hover {
    color: #2980b9;
}

/* Warchest Colors */
.warchest {
    font-weight: 600;
    color: #27ae60;
}

.warchest-low {
    font-weight: 600;
    color: #f39c12;
}

.warchest-critical {
    font-weight: 600;
    color: #e74c3c;
}

/* Date */
.date {
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.empty-state p {
    font-size: 1.2em;
}

/* Filter Buttons */
.filter-btn {
    padding: 10px 20px;
    background-color: white;
    border: 2px solid #3498db;
    color: #3498db;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s;
}

.filter-btn:hover {
    background-color: #ecf0f1;
}

.filter-btn.active {
    background-color: #3498db;
    color: white;
}

/* Sortable Headers */
.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.sortable-header:hover {
    background-color: #2980b9;
}

.sortable-header.active {
    background-color: #2980b9;
}

.sortable-header a {
    color: inherit;
    text-decoration: none;
    display: block;
}

.sortable-header a:hover {
    text-decoration: none;
}

.sort-indicator {
    margin-left: 5px;
    font-size: 0.8em;
}

/* Last Login Colors */
.last-login-recent {
    color: #27ae60;
    font-weight: 600;
}

.last-login-week {
    color: #f39c12;
    font-weight: 600;
}

.last-login-old {
    color: #e74c3c;
}

/* War Badge */
.war-badge {
    display: inline-block;
    background-color: #f39c12;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* War Cards */
.war-card {
    border-radius: 6px;
    padding: 8px 12px;
    background-color: white;
    min-width: 200px;
}

.war-card.offensive {
    border: 2px solid #3498db;
}

.war-card.defensive {
    border: 2px solid #e74c3c;
}

/* Discord Status */
.discord-status {
    text-align: center;
    font-size: 1.2em;
}

.discord-yes {
    color: #27ae60;
}

.discord-no {
    color: #e74c3c;
}

.discord-none {
    color: #95a5a6;
}

/* Section Headers */
.section-header {
    background-color: #34495e;
    color: white;
    padding: 15px 20px;
    margin-top: 30px;
    margin-bottom: 15px;
    border-radius: 8px;
    font-size: 1.3em;
    font-weight: 600;
}

/* Expand Button */
.expand-btn {
    cursor: pointer;
    display: inline-block;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 20px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
}
.expand-btn:hover {
    /*background-color: #2980b9;*/
}

/* War Details */
.war-details-row {
    display: none;
    background-color: #ecf0f1;
}

.war-details-row.visible {
    display: table-row;
}

.war-details-content {
    padding: 20px;
}

/* Damage Ratio Colors */
.total-damage-ratio {
    font-weight: 600;
    font-size: 0.9em;
}

.total-damage-ratio.good {
    color: #27ae60;
}

.total-damage-ratio.warning {
    color: #f39c12;
}

.total-damage-ratio.bad {
    color: #e74c3c;
}

/* Role Controls */
.role-controls {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.role-btn {
    padding: 6px 12px;
    border: 2px solid #95a5a6;
    background-color: white;
    color: #7f8c8d;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s;
}

.role-btn:hover {
    border-color: #3498db;
    background-color: #ecf0f1;
}

.role-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* Number Controls */
.number-control {
    position: relative;
    display: inline-block;
}

.number-control:hover .hover-popup {
    display: flex;
}

.hover-popup {
    position: absolute;
    display: none;
    align-items: center;
    gap: 4px;
    background-color: white;
    border: 2px solid #3498db;
    border-radius: 6px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 10;
    white-space: nowrap;
    left: 50%;
    transform: translateX(-50%);
}

.number-display {
    width: 35px;
    padding: 4px 8px;
    border: 1px solid #95a5a6;
    border-radius: 4px;
    text-align: center;
    font-size: 1em;
    font-weight: 600;
    background-color: white;
    display: inline-block;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    cursor: default !important;
}

.number-display.priority {
    width: 30px;
}

.number-control .slot-value,
.number-control .priority-value {
    transition: opacity 0.15s;
}

.number-control:hover .slot-value,
.number-control:hover .priority-value {
    opacity: 0;
}

.slot-value {
    width: 35px;
    padding: 4px 8px;
    border: 1px solid #95a5a6;
    border-radius: 4px;
    text-align: center;
    font-size: 1em;
    font-weight: 600;
    display: inline-block;
    background-color: white;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    cursor: default !important;
    pointer-events: none;
}

.priority-value {
    width: 30px;
    padding: 4px 8px;
    border: 1px solid #95a5a6;
    border-radius: 4px;
    text-align: center;
    font-size: 1em;
    font-weight: 600;
    display: inline-block;
    background-color: white;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    cursor: default !important;
    pointer-events: none;
}

.increment-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #3498db;
    background-color: white;
    color: #3498db;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.increment-btn:hover {
    background-color: #3498db;
    color: white;
}

/* Modified Row */
.row-modified {
    background-color: #fff3cd !important;
}

/* Error Message */
.error-msg {
    color: #e74c3c;
    font-size: 0.85em;
    /*margin-top: 4px;*/
}

/* Undo Button */
.undo-btn {
    background: none;
    border: none;
    color: #95a5a6;
    font-size: 1.5em;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    padding: 0;
}

.undo-btn.visible {
    opacity: 1;
    color: #e74c3c;
}

.undo-btn:hover {
    color: #c0392b;
    transform: scale(1.2);
}

.undo-column {
    width: 30px;
    min-width: 30px;
    max-width: 30px;
    text-align: center;
    padding: 0 8px;
}

/* Floating Save Bar */
.floating-save-bar {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2c3e50;
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: bottom 0.3s;
    z-index: 1000;
}

.floating-save-bar.visible {
    bottom: 30px;
}

.changes-count {
    font-weight: 600;
    font-size: 1.1em;
}

.save-all-btn,
.cancel-all-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1em;
}

.save-all-btn {
    background-color: #27ae60;
    color: white;
}

.save-all-btn:hover {
    background-color: #229954;
}

.save-all-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.cancel-all-btn {
    background-color: #95a5a6;
    color: white;
}

.cancel-all-btn:hover {
    background-color: #7f8c8d;
}

/* Summary Box */
.summary-box {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding: 15px 20px;
    background-color: #ecf0f1;
    border-radius: 8px;
    border: 2px solid #bdc3c7;
}

.summary-item {
    flex: 1;
    text-align: center;
}

.summary-item h3 {
    margin: 0 0 8px 0;
    font-size: 0.9em;
    color: #7f8c8d;
    font-weight: 600;
    text-transform: uppercase;
}

.summary-item .value {
    font-size: 1.8em;
    font-weight: 700;
    color: #2c3e50;
}

.summary-item .breakdown {
    font-size: 0.85em;
    color: #7f8c8d;
    margin-top: 4px;
}

.breakdown-peace {
    color: #3498db;
    font-weight: 600;
}

.breakdown-war {
    color: #e74c3c;
    font-weight: 600;
}

/* Rate Colors */
.rate-positive {
    color: #27ae60;
    font-weight: 600;
}

.rate-moderate {
    color: #f39c12;
    font-weight: 600;
}

.rate-heavy {
    color: #e74c3c;
    font-weight: 600;
}

/* Filter Styles */
.filter-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 15px 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.filter-label {
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.95em;
    margin-right: 5px;
}

.filter-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
    user-select: none;
}

.filter-checkbox:hover {
    background-color: #e8eaed;
}

.filter-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin: 0;
}

.filter-checkbox span {
    color: #555;
    font-size: 0.95em;
}

tr {
    height: 55px
}