* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Dark mode color variables you can adjust */
:root {
    --dark-bg: #32383e;
    --darker-bg: #282c34;
    --dark-element: #3e444c;
    --darker-element: #2c3238;
    --light-text: #e4e6eb;
    --muted-text: #b0b3b8;
    --border-color: #4e5459;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--dark-bg);
    color: var(--light-text);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.banner-image {
    width: 33%;
    height: auto;
    display: block;
    margin: 0 auto 20px auto;  /* top right bottom left */
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.image-container {
    width: 100%;
    margin-bottom: 20px;
}

h1, h2 {
    text-align: center;
    margin-bottom: 20px;
}

.form-container, .streak-container {
    background: var(--dark-element);
    color: var(--light-text);
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

input {
    flex: 1;
    padding: 8px;
    background-color: var(--darker-element);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--light-text);
}

button {
    padding: 8px 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background: #45a049;
}

.delete-btn {
    background: white;
    color: #f44336;
}

.delete-btn:hover {
    background: #d32f2f;
    color: white;
}

.increment-btn {
    background: white;
    color: #2196F3;
}

.increment-btn:hover {
    background: #0b7dda;
    color: white;
}

.restart-btn {
    background: white;
    color: #4CAF50;
}

.restart-btn:hover {
    background: #4CAF50;
    color: white;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table, th, td {
    border: 1px solid var(--border-color);
}

th, td {
    padding: 12px;
    text-align: left;
}

th {
    background-color: var(--darker-bg);
    color: var(--light-text);
}

tr:nth-child(even) {
    background-color: var(--darker-element);
}

tr:nth-child(odd) {
    background-color: var(--dark-element);
}

.status-message {
    margin: 10px 0;
    padding: 10px;
    border-radius: 4px;
}

.success {
    background-color: rgba(40, 167, 69, 0.2);
    color: #8fd19e;
}

.error {
    background-color: rgba(220, 53, 69, 0.2);
    color: #f5c6cb;
}

#status-message {
    display: none; /* Hide by default when empty */
    min-height: 40px;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
    background-image: url('/images/img.jpg');
    background-size: cover;
    background-position: center;
    color: white;
}

/* Show with styling when it has content */
#status-message.success, 
#status-message.error {
    display: block; /* Show when it has a class */
}

#status-message.success {
    background-color: rgba(40, 167, 69, 0.7); /* Semi-transparent green */
}

#status-message.error {
    background-color: rgba(220, 53, 69, 0.7); /* Semi-transparent red */
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: var(--dark-element);
    color: var(--light-text);
    margin: 15% auto;
    padding: 0;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 350px;
    animation: slideDown 0.3s;
}

.modal-header {
    padding: 12px 16px;
    background-color: #4CAF50;
    color: white;
    border-radius: 5px 5px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-modal {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

close-modal:hover {
    color: #f1f1f1;
}

.modal-body {
    padding: 16px;
    color: var(--light-text);
}

.modal-body p {
    margin-bottom: 12px;
}

.modal-body input {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    font-size: 16px;
}

.modal-footer {
    padding: 12px 16px;
    background-color: var(--darker-element);
    border-radius: 0 0 5px 5px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.error-message {
    color: #f5c6cb;
    display: none;
}

/* Animations */
@keyframes fadeIn {
    from {opacity: 0}
    to {opacity: 1}
}

@keyframes slideDown {
    from {transform: translateY(-50px); opacity: 0;}
    to {transform: translateY(0); opacity: 1;}
}

/* Modal button styles */
#submitPasswordBtn {
    background-color: #4CAF50;
}

#cancelPasswordBtn {
    background-color: #ccc;
    color: #333;
}

#cancelPasswordBtn:hover {
    background-color: #bbb;
}

/* Table layout improvements */
#streakTable {
    table-layout: fixed; /* Fixed layout for more predictable column widths */
}

/* Column width distribution */
#streakTable th:nth-child(1) {
    width: 60%; /* Username column - wider */
}

#streakTable th:nth-child(2) {
    width: 20%; /* Streak column - narrower */
    text-align: center;
}

#streakTable th:nth-child(3) {
    width: 20%; /* Actions column - narrower */
    text-align: center;
}

/* Align cell content */
#streakTable td:nth-child(2) {
    text-align: center; /* Center streak numbers */
    font-weight: bold;
}

#streakTable td:nth-child(3) {
    text-align: center; /* Center the action buttons */
}

/* Action buttons styling */
#streakTable .increment-btn,
#streakTable .delete-btn,
#streakTable .restart-btn {
    width: 30px;
    height: 30px;
    margin: 0 3px;
    border-radius: 50%;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Row hover effect */
#streakTable tbody tr:hover {
    background-color: var(--darker-bg);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    /* Container adjustments */
    .container {
        padding: 10px;
    }
    
    /* Banner image */
    .banner-image {
        width: 50%; /* Slightly larger on mobile */
    }
    
    /* Form adjustments */
    .form-group {
        flex-direction: column;
        gap: 8px;
    }
    
    input, button {
        width: 100%;
        padding: 12px; /* Larger touch targets */
    }
    
    /* Table adjustments */
    #streakTable {
        font-size: 14px;
    }
    
    #streakTable th, #streakTable td {
        padding: 8px 4px;
    }
    
    /* Adjust column widths for mobile */
    #streakTable th:nth-child(1) {
        width: 50%;
    }
    
    #streakTable th:nth-child(2), 
    #streakTable th:nth-child(3) {
        width: 25%;
    }
    
    /* Make action buttons slightly larger on mobile for easier touch */
    #streakTable .increment-btn,
    #streakTable .delete-btn {
        width: 36px;
        height: 36px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    /* Further adjustments for very small screens */
    .banner-image {
        width: 70%;
    }
    
    h1, h2 {
        font-size: 1.5rem;
    }
    
    #streakTable {
        font-size: 13px;
    }
    
    /* Make table take up all available space */
    #streakTable th:nth-child(1) {
        width: 45%;
    }
    
    #streakTable th:nth-child(2) {
        width: 20%;
    }
    
    #streakTable th:nth-child(3) {
        width: 35%; /* More space for buttons */
    }
}
