/* =====================================================
   VAT-Butler Custom Styles
   ===================================================== */

/* General Layout */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}

/* Sidebar Layout */
.sidebar {
    position: fixed;
    top: 56px; /* Height of navbar */
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 20px 0 0;
    overflow-x: hidden;
    overflow-y: auto;
}

@media (max-width: 767.98px) {
    .sidebar {
        position: static;
        top: auto;
        padding: 0;
    }
}

.sidebar .nav-link {
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    transition: all 0.3s ease;
}

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

.sidebar .nav-link.active {
    font-weight: 600;
}

/* Main content with sidebar */
@media (min-width: 768px) {
    .ms-sm-auto {
        margin-left: 16.666667% !important; /* col-lg-2 width */
    }
}

@media (min-width: 1200px) {
    .ms-sm-auto {
        margin-left: 20% !important; /* col-xl-2 width */
    }
}

/* Cards and Components */
.card {
    border: none;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.card-header {
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem 0.5rem 0 0;
}

/* Stat Cards */
.stat-card {
    text-align: center;
    padding: 2rem;
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .stat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Opportunity Cards */
.opportunity-card {
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.opportunity-card:hover {
    transform: translateX(5px);
}

.opportunity-card.quarterly {
    border-left-width: 5px !important;
}

.opportunity-card.yearly {
    border-left-width: 5px !important;
}

/* Quarter Cards */
.quarter-card {
    border-radius: 0.5rem;
    padding: 1rem;
    height: 100%;
    transition: all 0.3s ease;
}

/* Country Sections */
.country-section {
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Progress Bars */
.progress-thin {
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

/* Forms */
.form-control,
.form-select {
    border-radius: 0.375rem;
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 158, 247, 0.25);
}

/* Navbar */
.navbar-brand {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand img {
    height: 30px;
    width: auto;
}

/* Tooltips */
.tooltip-inner {
    max-width: 300px;
    text-align: left;
}

/* Info Tooltip */
.info-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: help;
    transition: all 0.3s ease;
}

.info-tooltip:hover {
    transform: scale(1.1);
}

/* Utility Classes */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Responsive Tables */
@media (max-width: 767.98px) {
    .table-responsive table {
        font-size: 0.875rem;
    }
}

/* Messages */
.messages {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 1050;
    max-width: 350px;
}

.messages .alert {
    margin-bottom: 1rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
}

/* Loading Spinner */
.spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* File Upload Area */
.upload-area {
    border: 2px dashed;
    border-radius: 0.5rem;
    padding: 3rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-style: solid;
}

.upload-area.dragover {
    border-style: solid;
    transform: scale(1.02);
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

/* Dark mode scrollbar */
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Print Styles */
@media print {
    .sidebar,
    .navbar,
    footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .ms-sm-auto {
        margin-left: 0 !important;
    }
}

/* ===== SAFARI ICON-FONT FIX ===== */
/* Diese Regeln lösen Safari-spezifische Icon-Font Probleme */
/* WICHTIG: Diesen Code ans Ende der bestehenden style.css anhängen! */

/* Zusätzliche @font-face Definition für bessere Browser-Kompatibilität */
@font-face {
    font-family: 'bootstrap-icons-backup';
    src: url('../css/fonts/bootstrap-icons.woff2') format('woff2'),
         url('../css/fonts/bootstrap-icons.woff') format('woff');
    font-display: swap;
    font-weight: normal;
    font-style: normal;
}

/* Safari-spezifische Icon-Korrekturen */
@supports (-webkit-appearance: none) {
    .bi::before,
    [class*=" bi-"]::before,
    [class^=bi-]::before {
        font-family: 'bootstrap-icons', 'bootstrap-icons-backup' !important;
        font-style: normal !important;
        font-weight: normal !important;
        font-variant: normal !important;
        text-transform: none !important;
        line-height: 1 !important;
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
        font-display: swap !important;
        display: inline-block !important;
        vertical-align: -.125em !important;
    }
}

/* Force reload von Icon-Fonts in Safari */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .bi::before,
    [class*=" bi-"]::before,
    [class^=bi-]::before {
        font-family: 'bootstrap-icons' !important;
        -webkit-font-feature-settings: normal !important;
        font-feature-settings: normal !important;
    }
}

/* WebKit-spezifische Korrekturen */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    @font-face {
        font-family: 'bootstrap-icons';
        src: url('../css/fonts/bootstrap-icons.woff2') format('woff2'),
             url('../css/fonts/bootstrap-icons.woff') format('woff');
        font-display: swap;
        font-weight: normal;
        font-style: normal;
    }
}

/* Spezifische Korrekturen für häufig verwendete Icons */
.bi-lightning-charge-fill::before {
    content: "\f46c" !important;
    font-family: 'bootstrap-icons' !important;
}

.bi-shield-fill-check::before {
    content: "\f531" !important;
    font-family: 'bootstrap-icons' !important;
}

.bi-piggy-bank-fill::before {
    content: "\f649" !important;
    font-family: 'bootstrap-icons' !important;
}

.bi-shield-check::before {
    content: "\f52f" !important;
    font-family: 'bootstrap-icons' !important;
}

.bi-graph-up-arrow::before {
    content: "\f673" !important;
    font-family: 'bootstrap-icons' !important;
}

.bi-clock-history::before {
    content: "\f292" !important;
    font-family: 'bootstrap-icons' !important;
}

.bi-person-circle::before {
    content: "\f4d7" !important;
    font-family: 'bootstrap-icons' !important;
}

.bi-box-arrow-in-right::before {
    content: "\f1be" !important;
    font-family: 'bootstrap-icons' !important;
}

.bi-receipt::before {
    content: "\f50f" !important;
    font-family: 'bootstrap-icons' !important;
}

/* Allgemeine Icon-Fallback-Regeln */
.bi::before {
    display: inline-block !important;
    width: 1em !important;
    height: 1em !important;
    vertical-align: -.125em !important;
    font-size: inherit !important;
}

/* Debugging für Development (auskommentiert) */
/*
.bi::before:empty,
[class*=" bi-"]::before:empty,
[class^=bi-]::before:empty {
    border: 1px solid red !important;
    background: #ffcccc !important;
    width: 1em !important;
    height: 1em !important;
    display: inline-block !important;
    content: "?" !important;
}
*/

/* Zusätzliche Safari-Kompatibilität */
@media all and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: .001dpcm) {
    .bi::before,
    [class*=" bi-"]::before,
    [class^=bi-]::before {
        font-family: 'bootstrap-icons' !important;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}