/* Basic styles for the application */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

header {
    background-color: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    font-weight: bold;
}

.user-info button {
    padding: 0.5rem 1rem;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.user-info button:hover {
    background-color: #c82333;
}

main {
    padding: 2rem;
}

/* Graph wrapper - contains loader and graph container */
.graph-wrapper {
    position: relative;
    margin-top: 2rem;
}

/* Braille loader - overlays the graph container */
.loader {
    font-size: 4rem;
    font-weight: 100;
    display: none; /* Hidden by default */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    color: #007bff;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    pointer-events: none; /* Allow clicks to pass through */
}

.loader::before {
    animation: braille 0.4s linear 0s infinite;
    content: "⠏";
}

@keyframes braille {
    0% {
        content: "⠏";
    }
    25% {
        content: "⠹";
    }
    50% {
        content: "⠼";
    }
    75% {
        content: "⠧";
    }
}

/* HTMX will add .htmx-request class during requests */
.loader.htmx-request {
    display: block !important;
}

/* Alert form styles */
.alert-form {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.alert-form input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex-grow: 1;
}

.alert-form button {
    padding: 0.5rem 1rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.alert-form button:hover {
    background-color: #0069d9;
}

/* Graph container */
.graph-container {
    margin-top: 2rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: white;
    min-height: 400px;
    position: relative; /* For absolute positioning of loader */
}

/* Login page styles */
.login-container {
    max-width: 400px;
    margin: 5rem auto;
    padding: 2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: white;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    text-align: center;
}

.form-group input {
    width: 80%;
    max-width: 300px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

button[type="submit"] {
    display: block;
    margin: 0 auto;
    width: auto;
    padding: 0.5rem 2rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

button[type="submit"]:hover {
    background-color: #0069d9;
}

.error-message {
    color: #dc3545;
    background-color: #f8d7da;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Summary statistics styles */
.summary-stats {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.summary-stats h3 {
    margin-top: 0;
    color: #495057;
}

.summary-stats table {
    width: 100%;
    border-collapse: collapse;
}

.summary-stats thead tr {
    background-color: #e9ecef;
}

.summary-stats th,
.summary-stats td {
    padding: 8px;
    text-align: left;
    border: 1px solid #dee2e6;
}

.summary-stats th:last-child,
.summary-stats td.value {
    text-align: right;
    font-family: monospace;
}

.summary-stats .total-row {
    font-weight: bold;
    background-color: #dee2e6;
    border-top: 2px solid #495057;
}

.summary-stats .total-row td {
    padding: 10px 8px;
}

/* Tab Navigation Styles */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-top: 2rem;
    margin-bottom: 0;
    border-bottom: 1px solid #e0e0e0;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    background-color: transparent;
    color: #666;
    text-decoration: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    bottom: -1px;
    display: inline-block;
}

.tab-button:hover {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.05);
}

.tab-button.active {
    color: #007bff;
    border-bottom-color: #007bff;
    font-weight: 600;
}

.tab-content {
    display: none;
    padding-top: 1rem;
}

.tab-content.active {
    display: block;
}

/* View Transition Styles */
@keyframes fade-in {
    from {
        opacity: 0;
    }
}

@keyframes fade-out {
    to {
        opacity: 0;
    }
}

@keyframes slide-from-right {
    from {
        transform: translateX(30px);
    }
}

@keyframes slide-to-left {
    to {
        transform: translateX(-30px);
    }
}

::view-transition-old(root) {
    animation:
        180ms cubic-bezier(0.4, 0, 1, 1) both fade-out,
        300ms cubic-bezier(0.4, 0, 0.2, 1) both slide-to-left;
}

::view-transition-new(root) {
    animation:
        320ms cubic-bezier(0, 0, 0.2, 1) 90ms both fade-in,
        300ms cubic-bezier(0.4, 0, 0.2, 1) both slide-from-right;
}
