/* CheckmyCarrier Main Styles
 * Premium B2B Design mit Gradients, Glassmorphism & Schatten
 */

/* ===== CSS Variables ===== */
:root {
    --primary-green: var(--primary);
    --primary-green-rgb: var(--primary-rgb);
    --primary-green-dark: var(--primary-dark);
    --primary-green-dark-rgb: var(--primary-dark-rgb);
    --primary-green-darker: var(--secondary);
    --primary-green-glow: rgba(var(--primary-green-rgb), 0.35);
    --bg-light: var(--primary-light);
    --bg-white: var(--bg-main);
    --bg-gradient: linear-gradient(160deg, var(--tinted-bg-50) 0%, var(--tinted-bg-200) 40%, var(--slate-50) 100%);
    --text-dark: var(--slate-800);
    --text-gray: var(--slate-500);
    --text-light: var(--slate-400);
    --border-color: rgba(var(--primary-green-rgb), 0.15);
    --border-color-solid: var(--slate-200);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 14px -2px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 40px -8px rgba(0, 0, 0, 0.1), 0 8px 16px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --shadow-green: 0 8px 30px -4px rgba(var(--primary-green-rgb), 0.3);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-dark);
    min-height: 100vh;
    position: relative;
}

/* Subtle decorative background shapes */
body::before {
    content: '';
    position: fixed;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(var(--primary-green-rgb), 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -150px;
    left: -150px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(var(--primary-green-dark-rgb), 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* ===== Top Navigation ===== */
.navbar-main {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.04);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-dark) !important;
    text-decoration: none;
}

.navbar-brand .brand-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.brand-mid{
    color: var(--brand-mid);
}

.navbar-brand .brand-highlight {
    color: var(--primary-green);
}

.nav-link-main {
    color: var(--text-gray) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    margin-right: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
    position: relative;
}

.nav-link-main:hover,
.nav-link-main.active {
    color: var(--primary-green) !important;
    background-color: rgba(var(--primary-green-rgb), 0.1);
}

.nav-link-main.active {
    font-weight: 600;
    box-shadow: inset 0 -2px 0 var(--primary-green);
}

/* Profile Avatar */
.profile-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-bounce);
    box-shadow: 0 2px 10px rgba(var(--primary-green-rgb), 0.3);
}

.profile-avatar:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 20px rgba(var(--primary-green-rgb), 0.4);
}

.dropdown-menu-end {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 0.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background-color: rgba(var(--primary-green-rgb), 0.1);
}

/* ===== Main Content ===== */
.main-content {
    max-width: 85%;
    margin: 0 auto;
    padding: 1rem 1rem;
    position: relative;
    z-index: 1;
}

.message-text {
    h1, h2, h3, h4, h5, h6 {
        margin-top: 1.5rem;
        margin-bottom: 0.5rem;
    }
}

/* ===== Section Visibility ===== */
.check-section,
.history-section,
.dashboard-section,
.profile-section {
    display: none;
}

.check-section.active,
.history-section.active,
.dashboard-section.active,
.profile-section.active {
    display: block;
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-green-darker);
}

.page-header .subtitle {
    color: var(--text-gray);
    font-size: 1.1rem;
}

/* ===== Check Form Card ===== */
.check-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: box-shadow var(--transition-base);
}

.check-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-green), var(--primary-green-dark), var(--primary-green));
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.check-card:hover {
    box-shadow: var(--shadow-xl);
}

.form-section {
    margin-bottom: 1.5rem;
}

.form-section-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--primary-green-dark);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    padding-left: 0.75rem;
    border-left: 3px solid var(--primary-green);
}

.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.form-control {
    border: 2px solid var(--border-color-solid);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all var(--transition-base);
    background: var(--bg-white);
}

.form-control:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(var(--primary-green-rgb), 0.12), 0 2px 8px rgba(var(--primary-green-rgb), 0.15);
    background: var(--tinted-bg-25);
}

.form-control:hover:not(:focus) {
    border-color: rgba(var(--primary-green-rgb), 0.4);
}

.form-control::placeholder {
    color: var(--text-light);
}

/* ===== Dropzone ===== */
.dropzone {
    border: 2px dashed rgba(var(--primary-green-rgb), 0.3);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
    text-align: center;
    background: linear-gradient(145deg, var(--tinted-bg-50) 0%, var(--tinted-bg-100) 100%);
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.dropzone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(var(--primary-green-rgb), 0.05), transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.dropzone:hover::before,
.dropzone.dragover::before {
    opacity: 1;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary-green);
    background: linear-gradient(145deg, var(--tinted-bg-hover-light) 0%, var(--tinted-bg-hover) 100%);
    box-shadow: 0 4px 20px rgba(var(--primary-green-rgb), 0.15);
}

.dropzone.dragover {
    transform: scale(1.01);
    box-shadow: 0 8px 30px rgba(var(--primary-green-rgb), 0.25);
}

.dropzone.max-reached {
    opacity: 0.7;
    cursor: not-allowed;
}

.dropzone.max-reached:hover {
    border-color: inherit;
    transform: none;
    box-shadow: none;
}

.dropzone.max-reached:hover::before {
    border-color: inherit;
}

.dropzone.max-reached .dropzone-prompt .dropzone-text {
    color: var(--text-light);
}

.dropzone-prompt {
    transition: all var(--transition-base);
}

.dropzone.has-files .dropzone-prompt {
    margin-bottom: 0.75rem;
}

.dropzone.has-files .dropzone-icon {
    display: none;
}

.dropzone.has-files .dropzone-hint {
    display: none;
}

.dropzone.has-files .dropzone-text {
    font-size: 0.9rem;
    margin-bottom: 0;
}

.dropzone-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.dropzone-text {
    font-size: 1rem;
    color: var(--text-gray);
    margin-bottom: 0.35rem;
}

.dropzone-hint {
    font-size: 0.8rem;
    color: var(--text-light);
}

.dropzone-browse {
    color: var(--primary-green);
    font-weight: 600;
    cursor: pointer;
}

.dropzone-browse:hover {
    text-decoration: underline;
}

/* File Previews (inside dropzone) */
.file-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}

.file-preview-item {
    position: relative;
    width: 90px;
    padding: 0.5rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.file-preview-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(var(--primary-green-rgb), 0.3);
}

.file-preview-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.file-preview-name {
    font-size: 0.7rem;
    color: var(--text-gray);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--status-critical), var(--danger));
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(var(--danger-rgb), 0.3);
    transition: transform var(--transition-bounce);
    z-index: 2;
}

.file-preview-remove:hover {
    transform: scale(1.2);
}

/* Dropzone Progress Bar */
.dropzone-progress {
    margin-top: 0.75rem;
    padding: 0 0.5rem;
}

.dropzone-progress-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropzone-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(var(--primary-green-rgb), 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.dropzone-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-green), var(--primary-green-dark));
    border-radius: 3px;
    transition: width 0.3s ease, background 0.3s ease;
    width: 0%;
}

.dropzone-progress-fill.warning {
    background: linear-gradient(90deg, #f0ad4e, #ec971f);
}

.dropzone-progress-fill.danger {
    background: linear-gradient(90deg, var(--status-critical), var(--danger));
}

.dropzone-progress-label {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    text-align: right;
}

/* ===== Submit Button ===== */
.btn-check-submit {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-dark) 50%, var(--primary-green-darker) 100%);
    background-size: 200% 200%;
    color: white;
    border: none;
    padding: 1.1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    width: 100%;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(var(--primary-green-rgb), 0.3);
    position: relative;
    overflow: hidden;
}

.btn-check-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.btn-check-submit:hover::before {
    left: 100%;
}

.btn-check-submit:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(var(--primary-green-rgb), 0.45);
    background-position: 100% 100%;
    color: white;
}

.btn-check-submit:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--primary-green-rgb), 0.35);
}

.btn-check-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== Loading Animation ===== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.97) 0%, rgba(var(--primary-rgb), 0.06) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-overlay.active {
    display: flex;
}

/* Orbit Spinner Animation */
.orbit-spinner {
    position: relative;
    width: 200px;
    height: 200px;
}

.orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 3px solid transparent;
    animation: orbit-spin linear infinite;
}

.orbit-1 {
    width: 100%;
    height: 100%;
    margin-top: -50%;
    margin-left: -50%;
    border-top-color: var(--primary-green);
    animation-duration: 3s;
}

.orbit-2 {
    width: 75%;
    height: 75%;
    margin-top: -37.5%;
    margin-left: -37.5%;
    border-right-color: var(--primary-green-dark);
    animation-duration: 2s;
    animation-direction: reverse;
}

.orbit-3 {
    width: 50%;
    height: 50%;
    margin-top: -25%;
    margin-left: -25%;
    border-bottom-color: var(--primary-green);
    animation-duration: 1.5s;
}

.orbit-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
}

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

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 0 0 rgba(var(--primary-green-rgb), 0.4);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 30px 10px rgba(var(--primary-green-rgb), 0.2);
    }
}

.loading-text {
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

.loading-subtext {
    margin-top: 1rem;
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    box-shadow: 0 4px 20px rgba(var(--primary-green-rgb), 0.25), 0 0 40px rgba(var(--primary-green-rgb), 0.1);
    border: 1px solid rgba(var(--primary-green-rgb), 0.3);
    animation: subtextPulse 2s ease-in-out infinite;
    transition: all 0.3s ease;
}

@keyframes subtextPulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(var(--primary-green-rgb), 0.25), 0 0 40px rgba(var(--primary-green-rgb), 0.1);
    }
    50% {
        box-shadow: 0 4px 30px rgba(var(--primary-green-rgb), 0.4), 0 0 60px rgba(var(--primary-green-rgb), 0.2);
    }
}

/* Progress Toast */
.progress-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    gap: 1rem;
    z-index: 10000;
    animation: slideUp 0.3s ease-out;
}

.progress-toast.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.progress-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== Result Section ===== */
.result-section {
    display: none;
}

.result-section.active {
    display: block;
}

.result-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.result-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

.result-header {
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.result-header.category-OK {
    background: linear-gradient(135deg, var(--status-ok) 0%, var(--status-ok-mid) 50%, var(--status-ok-dark) 100%);
    color: white;
    box-shadow: inset 0 -3px 10px rgba(0, 0, 0, 0.1);
}

.result-header.category-NEEDS_CHECK {
    background: linear-gradient(135deg, var(--status-warn) 0%, var(--status-warn-mid) 50%, var(--status-warn-dark) 100%);
    color: white;
    box-shadow: inset 0 -3px 10px rgba(0, 0, 0, 0.1);
}

.result-header.category-CRITICAL {
    background: linear-gradient(135deg, var(--status-critical) 0%, var(--status-critical-mid) 50%, var(--status-critical-dark) 100%);
    color: white;
    box-shadow: inset 0 -3px 10px rgba(0, 0, 0, 0.1);
}

.result-icon {
    font-size: 2.5rem;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.result-subtitle {
    opacity: 0.9;
}

.result-body {
    padding: 2rem;
}

.result-section-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-text {
    color: var(--text-gray);
    line-height: 1.6;
    white-space: pre-line;
}

.result-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

/* ===== History Section ===== */

.history-table {
    width: 100%;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.history-table th {
    background: linear-gradient(180deg, var(--tinted-bg-50) 0%, var(--tinted-bg-150) 100%);
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}

.history-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    transition: background var(--transition-base);
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-table tr:hover td {
    background: rgba(var(--primary-green-rgb), 0.04);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.status-badge.OK {
    background: linear-gradient(135deg, var(--status-ok-bg), var(--status-ok-bg-light));
    color: var(--status-ok-mid);
}

.status-badge.NEEDS_CHECK {
    background: linear-gradient(135deg, var(--status-warn-bg), var(--status-warn-bg-light));
    color: var(--status-warn-mid);
}

.status-badge.CRITICAL {
    background: linear-gradient(135deg, var(--status-critical-bg), var(--status-critical-bg-light));
    color: var(--status-critical-mid);
}

.status-badge.PENDING {
    background: linear-gradient(135deg, var(--status-pending-bg), var(--status-pending-bg-light));
    color: var(--status-pending);
}

.status-badge.FAILED {
    background: linear-gradient(135deg, var(--status-failed-bg), var(--status-failed-bg-light));
    color: var(--status-failed);
}

.status-badge.APP {
    background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
    color: #0369a1;
}

.status-badge.EMAIL {
    background: linear-gradient(135deg, #f3e8ff, #faf5ff);
    color: #7c3aed;
}

.history-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-gray);
}

.history-empty-icon {
    font-size: 3rem;
    opacity: 0.5;
    margin-bottom: 1rem;
}

/* ===== Footer ===== */
.main-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.875rem;
    position: relative;
    z-index: 1;
}

.navbar>.container, .navbar>.container-fluid, .navbar>.container-lg, .navbar>.container-md, .navbar>.container-sm, .navbar>.container-xl, .navbar>.container-xxl {
    max-width: 85% !important;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .check-card {
        padding: 1.5rem;
    }

    .dropzone {
        padding: 2rem 1rem;
    }

    .orbit-spinner {
        width: 150px;
        height: 150px;
    }

    .result-header {
        flex-direction: column;
        text-align: center;
    }
}

/* ===== Result Summary/Detail Toggle =====
 * We deliberately don't use a fixed max-height for the animation any more:
 * long detail views were being clipped at 5000px, causing the Markdown to
 * silently cut off (e.g. around the "Carrier-Informationen" section for
 * larger reports). Instead we fade + collapse via opacity and display so the
 * content can grow arbitrarily. */
.result-view {
    transition: opacity 0.35s ease;
    opacity: 1;
}

.result-view-hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.btn-detail-toggle {
    background: linear-gradient(135deg, var(--slate-50), var(--tinted-bg-100));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-detail-toggle:hover {
    background: linear-gradient(135deg, var(--tinted-bg-150), var(--tinted-bg-250));
    border-color: var(--primary-green);
    box-shadow: 0 4px 12px rgba(var(--primary-green-rgb), 0.15);
    transform: translateY(-1px);
}

.btn-detail-toggle .toggle-icon {
    margin-right: 0.25rem;
}

/* ===== Entrance Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.check-section.active .page-header {
    animation: fadeInUp 0.5s ease-out;
}

.check-section.active .check-card {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.history-section.active .page-header {
    animation: fadeInUp 0.5s ease-out;
}

.history-section.active .check-card {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.dashboard-section.active .page-header {
    animation: fadeInUp 0.5s ease-out;
}

.dashboard-section.active .card {
    animation: fadeInUp 0.4s ease-out;
}

.profile-section.active .page-header {
    animation: fadeInUp 0.5s ease-out;
}

.profile-section.active .check-card {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.result-section.active .result-card {
    animation: fadeInUp 0.5s ease-out;
}

/* ===== Quota Display (Profile) ===== */
.quota-display {
    background: linear-gradient(145deg, var(--tinted-bg-50) 0%, var(--tinted-bg-100) 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.quota-month-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.quota-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.quota-progress-bar-bg {
    flex: 1;
    height: 12px;
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.quota-progress-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.quota-progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

.quota-progress-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-dark);
    min-width: 40px;
    text-align: right;
}

.quota-stats {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
    margin-bottom: 1rem;
}

.quota-stat {
    text-align: center;
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.quota-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quota-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
}

.quota-stat-label {
    font-size: 0.75rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}


/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-green), var(--primary-green-dark));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-green-dark), var(--primary-green-darker));
}

/* ===== Selection Color ===== */
::selection {
    background: rgba(var(--primary-green-rgb), 0.2);
    color: var(--text-dark);
}

/* ===== Bootstrap Green Overrides ===== */
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--secondary);
    --bs-btn-hover-border-color: var(--primary-dark);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--secondary);
    --bs-btn-active-border-color: var(--secondary);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--primary);
    --bs-btn-disabled-border-color: var(--primary);
    --bs-btn-focus-shadow-rgb: var(--primary-rgb);
}

.btn-outline-primary {
    --bs-btn-color: var(--secondary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--primary);
    --bs-btn-hover-border-color: var(--primary);
    --bs-btn-focus-shadow-rgb: var(--primary-rgb);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--primary-dark);
    --bs-btn-active-border-color: var(--primary-dark);
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: var(--primary);
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: var(--primary);
    --bs-gradient: none;
}

.text-primary {
    color: var(--primary) !important;
}

.border-primary {
    border-color: var(--primary-green) !important;
}

.bg-primary {
    background-color: var(--primary-green) !important;
}

/* ===== Error Page ===== */

.error-container {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 3.5rem 2.5rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
}

.error-icon {
    font-size: 4.5rem;
    margin-bottom: 1.25rem;
    color: var(--status-warn);
}

.error-status-code {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.error-title {
    font-size: var(--fs-2xl);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.error-message {
    font-size: var(--fs-md);
    color: var(--text-gray);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.error-container .btn-check-submit {
    display: inline-flex;
    width: auto;
    padding: 0.85rem 2rem;
    font-size: var(--fs-md);
}

.error-details {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color-solid);
    font-size: var(--fs-sm);
    color: var(--text-light);
    font-weight: 600;
}

/* ===== Preference Toggle Buttons ===== */
.pref-toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

#prefLanguage {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.75rem;
}

.pref-toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color-solid);
    border-radius: var(--radius-lg);
    background: var(--bg-main);
    color: var(--text-gray);
    font-size: var(--fs-base);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.pref-toggle-btn:hover {
    border-color: rgba(var(--primary-green-rgb), 0.4);
    background: var(--tinted-bg-50);
    color: var(--text-dark);
    box-shadow: var(--shadow-sm);
}

.pref-toggle-btn.active {
    border-color: var(--primary-green);
    background: linear-gradient(145deg, var(--tinted-bg-100) 0%, var(--tinted-bg-200) 100%);
    color: var(--primary-green-darker);
    font-weight: 600;
    box-shadow: 0 0 0 1px rgba(var(--primary-green-rgb), 0.15), var(--shadow-sm);
}

.pref-toggle-btn.active::after {
    content: '\F272';
    font-family: 'bootstrap-icons';
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.65rem;
    color: var(--primary-green);
    opacity: 0.8;
}

.pref-toggle-flag {
    font-size: 1.4rem;
    line-height: 1;
}

.pref-toggle-icon {
    font-size: 1.2rem;
}

.pref-toggle-label {
    font-size: var(--fs-base);
}

/* ===== Conversation Media Preview ===== */
.media-preview-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.media-preview-heading {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.media-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.media-preview-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-dark);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    max-width: 320px;
}

.media-preview-item:hover {
    border-color: var(--primary-green);
    background: var(--tinted-bg-50);
    color: var(--primary-green-darker);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.media-preview-item .media-preview-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.media-preview-item .media-preview-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.media-preview-item .media-preview-size {
    color: var(--text-light);
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* Media Preview Modal – makes the embedded iframe/image fill the dialog */
#mediaPreviewModal .modal-dialog {
    max-width: 90vw;
}

#mediaPreviewModal .modal-body {
    padding: 0;
    background: var(--slate-50);
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#mediaPreviewModal .media-preview-frame,
#mediaPreviewModal .media-preview-image {
    width: 100%;
    height: 100%;
    border: 0;
}

#mediaPreviewModal .media-preview-image {
    object-fit: contain;
    background: var(--slate-100);
}

#mediaPreviewModal .media-preview-fallback {
    padding: 2rem;
    text-align: center;
    color: var(--text-gray);
}

.modal-header {
    --bs-modal-header-padding: 0.5rem;
}
