/* F-27: Inter font self-hosted (was Google Fonts).
   Inter v20 ships as a variable font — one woff2 file covers weights 400..800.
   See fonts/LICENSE.txt for the SIL Open Font License. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --background-dark: rgba(17, 24, 39, 0.8);
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-background: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.05);
    --modal-background: rgba(255, 255, 255, 0.95);
    --error-color: #ef4444;
    --success-color: #10b981;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-image: url(Hintergrund_Bild.jpg);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center top;
    background-attachment: fixed;
    min-height: 100vh;
    margin: 0;
    position: relative;
    overflow-x: hidden;
    color: var(--text-primary);
}

/* body::after {
  content: "";
  position: absolute;
  top: 100%; /* Startet direkt unterhalb des Body-Bereichs 
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url(Hintergrund_Bild.jpg);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center top;
  transform: scaleY(-1); /* Vertikale Spiegelung 
  opacity: 1; Optional: Transparenz für den Spiegeleffekt 
  z-index: -1;
} */

h1 {
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 0;
    letter-spacing: -0.025em;
}

h6 {
    font-size: 1.125rem;
    margin-top: 0;
    font-weight: 500;
    color: var(--text-secondary);
}

.festgeklebt {
    color: var(--text-primary);
    position: sticky;
    top: 10px;
    text-align: center;
    margin-top: 300px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    background: linear-gradient(180deg, var(--glass-background) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
}

.saluro {
    width: 50%;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.2));
    transition: transform 0.3s ease;
}

.saluro:hover {
    transform: scale(1.02);
}

.htl {
    width: 270px;
    height: 170px;
    display: block;
    margin: 0 auto;
    margin-top: 50vh;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.htl:hover {
    transform: translateY(-5px);
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
}

.autoren {
    color: var(--text-primary);
    margin-left: auto;
    margin-right: auto;
    margin-top: 120px;
    width: max-content;
    text-align: left;
    padding: 2rem;
    background: linear-gradient(135deg, var(--glass-background) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.autoren p {
    font-size: 1.25rem;
    margin: 0.5rem 0;
    font-weight: 500;
    transition: color 0.3s ease;
}

.autoren p:first-child {
    color: var(--text-secondary);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Authentication Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    gap: 40px;
}

.auth-box {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 300px;
}

.auth-box h2 {
    margin-bottom: 20px;
    text-align: center;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.auth-box button {
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.auth-box button:hover {
    background-color: #0056b3;
}

.error-message {
    color: #dc3545;
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
}

.success-message {
    color: #28a745;
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
}

/* Header and Auth Styles */
.header {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
}

.auth-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, var(--background-dark) 0%, rgba(17, 24, 39, 0.9) 100%);
    padding: 0.75rem 1.5rem;
    border-radius: 16px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
}

.auth-buttons {
    display: flex;
    gap: 0.75rem;
}

.auth-button {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.auth-button:active {
    transform: translateY(0);
}

.auth-button:disabled, .auth-button.loading {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#userInfo {
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}

#username {
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 0.25rem 0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 24, 39, 0.8);
    z-index: 2000;
    backdrop-filter: blur(12px);
}

.modal-content {
    position: relative;
    background: var(--modal-background);
    margin: 8% auto;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-sizing: border-box;
}

.close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    padding: 0;
    border: none;
    line-height: 1;
}

.close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #111827;
}

.modal h2 {
    color: #111827;
    text-align: center;
    margin: 0 0 2rem 0;
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.2;
}

.form-group {
    margin-bottom: 1.5rem;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f9fafb;
    box-sizing: border-box;
    margin: 0;
}

#loginModal .form-group input,
#registerModal .form-group input {
    color: #111827;
}

#loginModal .form-group input::placeholder,
#registerModal .form-group input::placeholder {
    color: #6b7280;
}

.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder {
    color: #9ca3af;
}

.error-message {
    color: var(--error-color);
    margin: 1rem 0 0 0;
    text-align: center;
    font-size: 0.875rem;
    background-color: rgba(239, 68, 68, 0.1);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 100%;
    box-sizing: border-box;
}

/* Form button specific styles */
.modal .auth-button {
    width: 100%;
    padding: 0.875rem;
    margin: 1rem 0 0 0;
    font-size: 1rem;
    box-sizing: border-box;
}

/* Form container */
.modal form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

/* Animation classes */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-1rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content {
    animation: modalFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header {
        top: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .auth-status {
        width: 100%;
        justify-content: center;
    }

    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }

    .festgeklebt {
        margin-top: 200px;
    }

    .autoren {
        margin-left: 1rem;
        margin-right: 1rem;
    }
}

/* Dashboard Styles */
.dashboard-body {
    background: #f3f4f6;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
}

.dashboard-nav {
    background: linear-gradient(135deg, var(--background-dark) 0%, rgba(17, 24, 39, 0.95) 100%);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-logo {
    height: 40px;
}

.nav-logo-img {
    height: 100%;
    width: auto;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
    font-size: 0.875rem;
}

.dashboard-container {
    max-width: 1200px;
    margin: 6rem auto 2rem;
    padding: 0 1.5rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.dashboard-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    color: #111827;
    /* Ensure text is dark on white background */
}

.dashboard-card h2 {
    color: #111827;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
}

.dashboard-card h3 {
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Balance Card */
.balance-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
}

.balance-card h2 {
    color: white;
    opacity: 0.9;
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: 700;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.currency {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* Transfer Card */
.transfer-card form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Dashboard Inputs */
.dashboard-card input {
    background: #f9fafb;
    color: #111827;
    border: 1px solid #d1d5db;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    width: 100%;
}

.dashboard-card input::placeholder {
    color: #9ca3af;
}

.dashboard-card input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Transaction History */
.transaction-list {
    display: flex;
    flex-direction: column;
    max-height: 400px;
    overflow-y: auto;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.transaction-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1; /* Allow this to grow and take available space */
    padding-right: 1rem;
    min-width: 0; /* Enable text truncation if needed */
}

.transaction-user {
    font-weight: 600;
    color: #111827;
}

.transaction-description {
    font-size: 0.875rem;
    color: #6b7280;
    white-space: nowrap; /* Prevent wrapping */
    overflow: visible; /* Show as much as possible, let card expand if necessary */
    /* Alternatively for true truncation: overflow: hidden; text-overflow: ellipsis; */
}

.transaction-details-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0; /* Prevent right side from squishing */
}

.transaction-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.amount {
    font-weight: 600;
    font-size: 1.125rem;
}

.amount.sent {
    color: #ef4444;
}

.amount.received {
    color: #10b981;
}

.transaction-date {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Remove number input spinner arrows */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    -webkit-animation: spin 1s ease-in-out infinite;
    margin-right: 0.5em;
}

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

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .dashboard-container {
        margin-top: 5rem;
        padding: 0 1rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .nav-user {
        font-size: 0.8125rem;
    }

    .balance-amount {
        font-size: 2rem;
    }
}
