/* styles.css */
body { 
    font-family: sans-serif; 
    margin: 20px; 
}
.tabs { 
    display: flex; 
    cursor: pointer; 
    margin-bottom: 20px; 
}
.tab { 
    padding: 10px 20px; 
    border: 1px solid #ccc; 
    margin-right: 5px; 
    background: #f5f5f5; 
}
.tab.active { 
    background: #007bff; 
    color: white; 
    border-color: #007bff; 
}
.period-select { 
    margin-bottom: 15px; 
    padding: 5px; 
    margin-right: 10px; 
}
.timezone-info { 
    margin-bottom: 15px; 
    padding: 8px; 
    background-color: #f8f9fa; 
    border-left: 4px solid #007bff;
}

/* Fiksuotos lentelės stiliai */
.table-container {
    max-height: 70vh;
    overflow: auto;
    border: 1px solid #ccc;
    position: relative;
    margin-bottom: 20px;
}
table { 
    border-collapse: collapse; 
    width: 100%; 
    position: relative;
}
thead {
    position: sticky;
    top: 0;
    z-index: 10;
}
th, td { 
    border: 1px solid #ccc; 
    padding: 8px; 
    text-align: center; 
}
th { 
    background-color: #f8f9fa; 
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 1px 0 #ccc;
}

.low-chest-count { 
    background-color: rgb(255, 187, 187) !important;
    position: relative;
}
.low-chest-count:hover::after {
    content: attr(title);
    position: absolute;
    top: -30px;
    left: 0;
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 5;
}
#chestTable tr:hover, #troopsTable tr:hover, #historyTable tr:hover {
    background-color: #f5f5f5;
}
.info-box {
    margin: 10px 0;
    padding: 8px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
}
.info-note {
    margin: 10px 0;
    padding: 8px;
    background-color: #f0f7ff;
    border: 1px solid #c5d9f1;
    border-radius: 4px;
    font-size: 14px;
    color: #2e6da4;
    font-style: italic;
}
.legend {
    margin: 5px 0;
    font-size: 12px;
    color: #888;
}
button {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}
button:hover {
    background: #0056b3;
}
.sortable { 
    cursor: pointer; 
    position: relative;
    padding-right: 20px !important;
}
.sortable:hover {
    background-color: #e9ecef;
}
.sortable::after {
    content: '↕';
    position: absolute;
    right: 5px;
    color: #999;
}
.sortable.asc::after {
    content: '↑';
    color: #000;
}
.sortable.desc::after {
    content: '↓';
    color: #000;
}
.controls {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.total-column {
    font-weight: bold;
    background-color: #e9ecef;
}

/* Modal stiliai */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}
.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: auto;
    position: relative;
}
.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}
.close:hover {
    color: #000;
}
.player-name-header {
    margin-top: 0;
    color: #007bff;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}
.clickable-player {
    color: #007bff;
    cursor: pointer;
    text-decoration: underline;
}
.clickable-player:hover {
    color: #0056b3;
    background-color: #f8f9fa;
}
.history-table {
    margin-top: 20px;
}
.history-table th {
    background-color: #e9ecef;
}
.no-data {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* Activity chart */
#activityChart {
    max-width: 100%;
    height: 400px;
}

/* Troop levels */
.troop-level { 
    text-align: center; 
    font-weight: bold;
}
.troop-level.g { color: #2e7d32; }
.troop-level.s { color: #1565c0; }
.troop-level.m { color: #7b1fa2; }
.troop-level.e { color: #d32f2f; }

/* Login form styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}
.login-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 2;
}
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}
.logo-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.login-form .form-group {
    margin-bottom: 1.5rem;
}
.input-wrapper {
    position: relative;
    margin-bottom: 0.5rem;
}
.input-wrapper input {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 2px solid #ddd;
    background: transparent;
    font-size: 16px;
    transition: border-color 0.3s;
}
.input-wrapper input:focus {
    outline: none;
    border-color: #007bff;
}
.input-wrapper label {
    position: absolute;
    top: 12px;
    left: 0;
    font-size: 16px;
    color: #999;
    pointer-events: none;
    transition: 0.3s;
}
.input-wrapper input:focus + label,
.input-wrapper input:valid + label {
    top: -20px;
    font-size: 12px;
    color: #007bff;
}
.input-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #007bff;
    transition: 0.3s;
}
.input-wrapper input:focus ~ .input-line {
    width: 100%;
}
.error-message {
    color: #dc3545;
    font-size: 12px;
    display: block;
    margin-top: 5px;
}
.login-btn {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}
.login-btn:hover {
    background: #0056b3;
}
.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: 0.3s;
}
.login-btn:active .btn-glow {
    width: 100px;
    height: 100px;
}
.background-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.3;
}
.glow-orb-1 {
    width: 200px;
    height: 200px;
    background: #ff6b6b;
    top: 10%;
    left: 10%;
    animation: float 6s ease-in-out infinite;
}
.glow-orb-2 {
    width: 150px;
    height: 150px;
    background: #4ecdc4;
    top: 60%;
    right: 10%;
    animation: float 8s ease-in-out infinite;
}
.glow-orb-3 {
    width: 100px;
    height: 100px;
    background: #45b7d1;
    bottom: 20%;
    left: 20%;
    animation: float 10s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}