/* Main Styles for Affiliate Redirect System */

/* Wichtige Zentrierungsregeln - diese haben Priorität */
.container-wrapper {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 20px !important;
}

.main-container {
    width: 100% !important;
    max-width: 1600px !important; /* Von 1200px auf 1600px erhöht (1/3 breiter) */
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    background-color: white;
    border-radius: 0.25rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    padding: 1.5rem;
}

/* Verbesserte Responsivität */
@media (max-width: 1650px) {
    .main-container {
        max-width: 95% !important;
    }
}

@media (max-width: 992px) {
    .container-wrapper {
        padding: 15px !important;
    }
    
    .main-container {
        padding: 1rem;
    }
    
    /* Verbessere die Mobilansicht von Tabellen */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Kleinere Schrift auf mobilen Geräten */
    body {
        font-size: 0.9rem;
    }
    
    /* Header anpassen */
    header.bg-dark {
        flex-direction: column;
    }
    
    header.bg-dark nav {
        margin-top: 10px;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    header.bg-dark .btn {
        margin-bottom: 5px;
    }
}

@media (max-width: 576px) {
    .container-wrapper {
        padding: 10px !important;
    }
    
    .main-container {
        padding: 0.8rem;
    }
    
    /* Noch kleinere Buttons auf sehr kleinen Geräten */
    header.bg-dark .btn {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Restliche Grundstile */
html, body {
    height: 100%;
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8f9fa;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

/* Verbesserte Tabellendarstellung */
.table-responsive {
    width: 100%;
    margin-bottom: 1rem;
    overflow-x: auto;
}

.table {
    width: 100%;
    max-width: 100%;
    margin-bottom: 1rem;
}

/* Speziell für Login und Passwort vergessen Seiten */
.auth-form-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.truncate {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

.link-hover:hover {
    text-decoration: underline;
    cursor: pointer;
}

.copy-btn {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
}

.tracking-url-container {
    position: relative;
}

.tooltip-inner {
    max-width: 400px;
    text-align: left;
}

.form-wider {
    max-width: 95%;
    margin: 0 auto;
}

.dropdown-item.text-danger:hover {
    background-color: #f8d7da;
}

/* Content Container */
.content-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Footer Styles */
.footer {
    z-index: 1020 !important;
    position: relative !important;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    color: #6c757d;
    text-align: center;
    font-size: 14px;
}

.footer a {
    color: #6c757d;
    text-decoration: none;
    margin: 0 10px;
}

.footer a:hover {
    color: #495057;
    text-decoration: underline;
}

/* Impersonation-Hinweis */
.impersonation-banner {
    background-color: #ffc107;
    color: #212529;
    padding: 0.5rem 1rem;
    text-align: center;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
}

/* Accordion für collapsible sections */
.accordion-button:not(.collapsed) {
    background-color: #e7f1ff;
    color: #0c63e4;
}

/* Loading-Overlay */
#loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.spinner-container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

/* Styles for modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1050 !important;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #ffffff !important;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 5px;
    opacity: 1 !important;
    color: #212529 !important;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

/* Redirect page styles */
.redirect-page body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.redirect-container {
    text-align: center;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    max-width: 90%;
    width: 600px;
}

.loader {
    width: 60px;
    height: 60px;
    margin: 1.5rem auto;
    position: relative;
}

.loader:before {
    content: "";
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid #f3f3f3;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 0;
    left: 0;
}

.image-container {
    margin: 1rem auto;
    max-width: 100%;
}

.image-container img {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.counter {
    font-size: 1.2rem;
    font-weight: bold;
}