body {
    font-family: 'Open Sans', Arial, sans-serif;
    background-color: #f9f9f9;
    margin: 0;
    /*padding: 20px;*/
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #42a5f5;
    margin-bottom: 10px;
}

nav a {
    margin: 0 10px;
    text-decoration: none;
    color: #42a5f5;
    font-weight: bold;
}

nav a:hover {
    text-decoration: underline;
}

main {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.05);
    max-width: 900px;
    margin: auto;
}

/* Tabelle */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #42a5f5;
    color: white;
    font-weight: bold;
}

tr:hover {
    background-color: #f1f1f1;
}

/* Buttons */
button {
    background-color: #42a5f5;
    color: white;
    border: none;
    padding: 10px 16px;
    margin-top: 8px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 15px;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #1e88e5;
}

/* Sync-Icon */
#sync-indicator {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 24px;
    animation: spin 2s linear infinite;
    display: none;
    color: #42a5f5;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Notification */
#notification {
    position: fixed;
    bottom: 50px;
    right: 10px;
    background-color: #42a5f5;
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

#notification.hidden {
    display: none;
}

/* Progressbar */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, #42a5f5 0%, #1e88e5 100%);
    animation: progressAnimation 2s infinite;
}

@keyframes progressAnimation {
    0% { background-position: 0% 0; }
    100% { background-position: 100% 0; }
}

#progress-bar.hidden {
    display: none;
}

/* Formulareingaben */
input[type="text"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 10px;
    margin: 8px 0 16px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}

.paid-badge {
    display: inline-block;
    background-color: #4CAF50;
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 14px;
}

/* Responsive Tabelle */
@media (max-width: 600px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead {
        display: none; /* Tabellenkopf ausblenden auf Mobile */
    }

    tr {
        margin-bottom: 15px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
        padding: 10px;
    }

    td {
        text-align: left;
        padding: 8px;
        position: relative;
        padding-left: 50%;
    }

    td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        top: 8px;
        font-weight: bold;
        color: #555;
        white-space: nowrap;
    }
}

/* Karten / Tabellenzeilen */
@media (max-width: 600px) {
    tr {
        background: #f5f5f5; /* leichtes Grau für die Karten */
        margin-bottom: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        padding: 10px;
        animation: slideFadeIn 0.6s ease forwards;
        opacity: 0; /* Startzustand für Animation */
    }
}

/* Animation Definition */
@keyframes slideFadeIn {
    0% {
        transform: translateY(10px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #42a5f5;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    animation: spinLoader 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes spinLoader {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Cards für Raten */
.responsive-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.card {
    background: white;
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: scale(1.02);
}

.card div {
    margin-bottom: 8px;
    font-size: 16px;
    color: #333;
}

.card strong {
    color: #42a5f5;
}

/* Optional: Link-Schaltflächen in Karten */
.btn-link {
    display: inline-block;
    margin-top: 10px;
    color: #42a5f5;
    text-decoration: none;
    font-weight: bold;
}

.btn-link:hover {
    text-decoration: underline;
}


/* Kreditdetails Card */
.card {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* Fortschrittsbalken */
#progress-container {
    margin-bottom: 30px;
}

#progress-text {
    margin-bottom: 8px;
    font-weight: bold;
}

#progress-bar-container {
    width: 100%;
    background-color: #eee;
    border-radius: 8px;
    overflow: hidden;
    height: 20px;
}

#progress-bar-inner {
    height: 100%;
    background-color: #42a5f5;
    width: 0;
    transition: width 0.5s ease;
    border-radius: 8px; /* NEU */
}

/* Bezahlte Raten farblich abheben */
.paid-row {
    background-color: #e8f5e9; /* leichtes Grün */
}

.responsive-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.logout-button {
    color: #e53935;
    text-decoration: none;
    font-weight: bold;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
input[type="email"],
select,
textarea {
    -webkit-appearance: none; /* iOS: entfernt Shadow, Glanz, etc. */
    -moz-appearance: none;
    appearance: none;

    background-color: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px;
    font-size: 16px;
    width: 100%;
    margin: 8px 0 16px 0;
    font-family: 'Open Sans', Arial, sans-serif;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #42a5f5;
    box-shadow: 0 0 0 2px rgba(66, 165, 245, 0.3);
}

/* iOS Safari Fix für <select> Pfeile */
select {
    background: white url("data:image/svg+xml;utf8,<svg fill='gray' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d=\'M7 10l5 5 5-5z\'/></svg>") no-repeat right 12px center;
    background-size: 16px 16px;
    padding-right: 36px;
    cursor: pointer;
}
