/* Login-spezifische Styles */

/* Allgemeine Styles */
:root {
    --sidebar-width: 260px;
    --header-height: 60px;
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --success-color: #2ecc71;
    --warning-color: rgb(228, 141, 0);
    --danger-color: #e74c3c;
    color-scheme: light only;
}

body {
    min-height: 100vh;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

/* Login Page Styles */
.login-container {
    max-width: 400px;
    width: 100%;
    padding: 15px;
    margin: 0 auto;
}

.card {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    background-color: #f7f7f7; /* Neue Hintergrundfarbe */
    color: rgb(13, 110, 253);       /* Neue Schriftfarbe */
    text-align: center;
    padding: 20px;
}

.card-header h6 {
    color: #1056f6;
    margin: 0;
}

.card-header .logo {
    font-size: 24px;
    font-weight: bold;
}

.card-body {
    padding: 30px;
}

.form-control {
    padding: 12px;
    height: auto;
    border-radius: 5px;
}

.btn-primary { /* This rule will now use the updated --primary-color */
    padding: 12px;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
}

.btn-primary:hover { /* This rule will now use the updated --secondary-color */
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-label {
    font-weight: 600;
}

.alert {
    border-radius: 5px;
}

/* Animation */
.animate {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Header Styles */
.login-header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.brand a {
    color: #333;
    text-decoration: none;
}

/* Benutzermenü Styles */
.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Benachrichtigungsdot */
.notification-dot { /* This uses a specific color, not a variable from the root */
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #dc3545;
    border-radius: 50%;
    margin-left: 5px;
}

/* Systemnachrichten Container */
.system-messages-container {
    margin: 1rem 0;
}

/* API Nutzungsdiagramm Styles */
.graph-container {
    margin-top: 20px;
    position: relative;
}

.api-graph {
    display: flex;
    height: 200px;
    position: relative;
    border-bottom: 1px solid #ddd;
    border-left: 1px solid #ddd;
    margin-left: 60px;
    margin-right: 60px;
}

.y-axis {
    position: absolute;
    width: 60px;
    height: 100%;
    left: -60px;
    bottom: 0;
}

.y-axis.right {
    left: auto;
    right: -60px;
}

.y-label {
    position: absolute;
    right: 5px;
    font-size: 0.7rem;
    color: #666;
    transform: translateY(50%);
    white-space: nowrap;
}

.y-axis.right .y-label {
    right: auto;
    left: 5px;
}

.graph-content {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    width: 100%;
    height: 100%;
    padding: 0 5px;
}

.graph-bar-group {
    display: flex;
    align-items: flex-end;
    flex: 1;
    max-width: 45px;
    justify-content: center;
    height: 100%;
    position: relative;
    margin: 0 1px;
}

.graph-bar {
    width: 15px;
    position: relative;
    border-radius: 3px 3px 0 0;
    transition: height 0.3s;
    margin: 0 1px;
}

.graph-bar.requests {
    background-color: var(--primary-color);
}

.graph-bar.tokens {
    background-color: var(--success-color);
}

.graph-bar.previous {
    background-color: var(--success-color);
}

.bar-value {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%) rotate(-45deg);
    transform-origin: center bottom;
    font-size: 0.65rem;
    font-weight: bold;
    color: #555;
    white-space: nowrap;
    z-index: 1;
    padding: 1px 3px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
    display: none;
}

.graph-bar:hover .bar-value {
    display: block;
}

.graph-bar[style*="height: 0px;"] .bar-value,
.graph-bar[style*="height: 0;"] .bar-value {
    display: none !important;
}

.x-label {
    position: absolute;
    bottom: -20px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.7rem;
    color: #666;
}

.graph-legend {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 0 15px;
}

.legend-color {
    width: 15px;
    height: 15px;
    margin-right: 5px;
    border-radius: 3px;
}

.legend-color.requests {
    background-color: var(--primary-color);
}

.legend-color.tokens {
    background-color: var(--success-color);
}

.legend-color.previous {
    background-color: var(--success-color);
}

/* Responsive Design */
@media (max-width: 992px) {
    .customer-sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
        box-shadow: none;
        z-index: 1030;
        position: fixed;
        top: 0;
        bottom: 0;
        overflow-y: auto;
        transition: all 0.3s ease;
    }
    
    .customer-sidebar.show {
        margin-left: 0;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    }
    
    .customer-main {
        margin-left: 0 !important;
        width: 100%;
        transition: all 0.3s ease;
    }
    
    .customer-header .brand {
        width: auto;
        padding-left: 10px;
    }
    
    .toggle-sidebar {
        display: block !important;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .login-container {
        max-width: 100%;
    }
    
    .card {
        margin: 0;
    }
    
    .login-header {
        padding: 0.5rem;
    }
    
    .brand {
        font-size: 1.2rem;
    }
    
    .user-menu {
        gap: 0.5rem;
    }
    
    .api-graph {
        margin-left: 50px;
        margin-right: 50px;
    }
    
    .y-axis {
        width: 50px;
        left: -50px;
    }
    
    .y-axis.right {
        right: -50px;
    }
    
    .y-label {
        font-size: 0.65rem;
    }
    
    .graph-bar {
        width: 12px;
    }
    
    .graph-bar-group {
        max-width: 35px;
    }
}

@media (max-width: 576px) {
    .login-container {
        padding: 10px;
    }
    
    .card {
        border-radius: 8px;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .form-control {
        padding: 10px;
    }
    
    .btn-primary {
        padding: 10px;
    }
    
    .card-header {
        padding: 15px;
    }
    
    .card-header .logo {
        font-size: 20px;
    }
    
    .y-axis .y-label:nth-child(2),
    .y-axis .y-label:nth-child(4) {
        display: none;
    }
    
    .graph-bar-group:nth-of-type(even) .x-label {
        display: none;
    }
    
    .graph-bar {
        width: 10px;
    }
    
    .graph-bar-group {
        max-width: 28px;
    }
    
    .bar-value {
        font-size: 0.6rem;
        top: -16px;
    }
}

/* Sidebar */
.customer-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: #343a40;
    color: #fff;
    padding-top: var(--header-height);
    transition: all 0.3s;
    z-index: 990;
    overflow-y: auto;
}

.customer-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.85);
    padding: 12px 20px;
    margin: 2px 0;
    border-left: 3px solid transparent;
}

.customer-sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.customer-sidebar .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--primary-color);
}

.customer-sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Main content */
.customer-main {
    margin-left: var(--sidebar-width);
    padding: 20px;
    padding-top: calc(var(--header-height) + 10px);
    min-height: 100vh;
}

/* Header */
.customer-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.customer-header .brand {
    width: var(--sidebar-width);
    margin-left: -20px;
    padding-left: 20px;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.2rem;
    height: 100%;
    display: flex;
    align-items: center;
    background: #343a40;
}

.customer-header .brand a {
    color: #fff;
    text-decoration: none;
}

.customer-header .user-menu {
    margin-left: auto;
}

/* Dashboard Cards */
.stats-card {
    border-radius: 10px;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.3s;
}

.stats-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.stats-card .icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Buttons & Forms */
/* .btn-primary is already defined above and will use the new root variables */

.form-control:focus { /* This rule will now use the updated --primary-color */
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25); /* Alpha value from admin.css for primary-color focus */
}

/* Tables */
.table-container {
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Helper für Border mit speziellen Farben */
.border-left-primary { /* This rule will now use the updated --primary-color */
    border-left: 4px solid var(--primary-color) !important;
}
.border-left-success { /* This rule will now use the updated --success-color */
    border-left: 4px solid var(--success-color) !important;
}
.border-left-info { /* This rule will now use the updated --primary-color (as per admin.css logic for info) */
    border-left: 4px solid var(--primary-color) !important;
}
.border-left-warning { /* This rule will now use the updated --warning-color */
    border-left: 4px solid var(--warning-color) !important;
}
.border-left-danger { /* This rule will now use the updated --danger-color */
    border-left: 4px solid var(--danger-color) !important;
}

/* System messages container */
.system-messages-container {
    padding: 0 20px;
    margin-top: 0;
    margin-bottom: 10px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1020;
}

.sidebar-overlay.show {
    display: block;
}

/* --- Erweiterte Login-Styles (2024) --- */

.card-header h4 {
    color: #1056f6;
    margin: 0;
}

.card-header .logo {
    max-width: 200px;
    height: auto;
}

/* Shake Animation für Fehler */
.shake {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes shake {
    10%, 90% {
        transform: translate3d(-1px, 0, 0);
    }
    20%, 80% {
        transform: translate3d(2px, 0, 0);
    }
    30%, 50%, 70% {
        transform: translate3d(-4px, 0, 0);
    }
    40%, 60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* Password Strength Indicator */
.password-requirements {
    font-size: 0.85rem;
    color: #6c757d;
}

.password-requirements .requirement {
    margin-bottom: 2px;
    transition: color 0.3s ease;
}

.password-requirements .requirement i {
    width: 16px;
    transition: all 0.3s ease;
}

.requirement.valid {
    color: #28a745;
}

.requirement.valid i {
    transform: scale(1.1);
}

.requirement.invalid {
    color: #dc3545;
}

.password-strength {
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 5px;
}

.password-strength-bar {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-weak { 
    background-color: #dc3545; 
    width: 25%; 
}

.strength-fair { 
    background-color: #fd7e14; 
    width: 50%; 
}

.strength-good { 
    background-color: #ffc107; 
    width: 75%; 
}

.strength-strong { 
    background-color: #28a745; 
    width: 100%; 
}

/* Input Groups */
.input-group .form-control {
    border-right: 0;
}

.input-group .btn-outline-secondary {
    border-left: 0;
    background-color: transparent;
}

.input-group .btn-outline-secondary:hover {
    background-color: #f8f9fa;
}

/* Enhanced Alerts */
.alert {
    border: none;
    border-left: 4px solid;
    border-radius: 0.375rem;
}

.alert-success {
    border-left-color: var(--success-color);
    background-color: rgba(46, 204, 113, 0.1);
}

.alert-danger {
    border-left-color: var(--danger-color);
    background-color: rgba(231, 76, 60, 0.1);
}

.alert-warning {
    border-left-color: var(--warning-color);
    background-color: rgba(228, 141, 0, 0.1);
}

.alert-info {
    border-left-color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.1);
}

/* Loading States */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Form Validation Enhancements */
.form-control.is-valid {
    border-color: var(--success-color);
    background-image: none;
}

.form-control.is-invalid {
    border-color: var(--danger-color);
    background-image: none;
}

.form-control.is-valid:focus,
.form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Responsive Improvements */
@media (max-width: 576px) {
    .login-container {
        padding: 10px;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .card-header {
        padding: 15px;
    }
    
    .card-header .logo {
        max-width: 150px;
    }
}

/* Hover Effects */
.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
}

/* Card Hover Effects */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Focus Improvements */
.form-control:focus,
.form-select:focus,
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Link Styling */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

/* Footer Styles */
footer {
    margin-top: 2rem;
}

.footer-links a {
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color) !important;
}

/* Success/Error Icons */
.fas.fa-check-circle {
    color: var(--success-color);
}

.fas.fa-times-circle,
.fas.fa-exclamation-triangle.text-danger {
    color: var(--danger-color);
}

.fas.fa-exclamation-triangle.text-warning {
    color: var(--warning-color);
}

.fas.fa-info-circle {
    color: var(--primary-color);
}

/* Dark Mode Support deaktiviert - Seite immer im Light Mode */
/* @media (prefers-color-scheme: dark) {
    :root {
        --card-bg: #2c3e50;
        --text-color: #ecf0f1;
        --input-bg: #34495e;
    }
    
    body {
        background-color: #1a252f;
        color: var(--text-color);
    }
    
    .card {
        background-color: var(--card-bg);
        color: var(--text-color);
    }
    
    .card-header {
        background-color: #34495e;
        color: var(--text-color);
    }
    
    .form-control {
        background-color: var(--input-bg);
        border-color: #4a5f7a;
        color: var(--text-color);
    }
    
    .form-control:focus {
        background-color: var(--input-bg);
        border-color: var(--primary-color);
        color: var(--text-color);
    }
} */

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .shake {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn-primary {
        background-color: #000;
        border-color: #000;
        color: #fff;
    }
    
    .form-control {
        border: 2px solid #000;
    }
}

/* Print Styles */
@media print {
    .login-container {
        max-width: none;
        width: 100%;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .btn {
        display: none;
    }
}