/* Custom styles for Mailing Administration System */
/*
   * Важливо! На сайті використовується темна та світла тема.
   * Для подальшого підтримання кольорової гами необхідно в стилях використовувати змінні кольорів: var(--type-color)
    замість статичного кольору
   * Змінні кольорів прописані у файлі bootstrap.min.css (відкрити через консоль браузеру) у селекторі :root або тут
*/
:root {
    --transition: .25s;
}
:root,[data-bs-theme=light] {
    --color-blue-white: var(--bs-link-hover-color);
}
[data-bs-theme=dark] {
    color-scheme: dark;
    --color-blue-white: #fff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
a {
    text-decoration: none;
    transition: var(--transition);
}
[disabled] {
    cursor: not-allowed;
}
p:last-child {
    margin-bottom: 0;
}
.text-blue-white {
    color: var(--color-blue-white);
}
html {
    scrollbar-width: thin;
}
html, body {
    height: 100%;
}
.wrapper {
    height: 100%;
}

.wrapper__container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.header {
    position: fixed;
    width: 100%;
    z-index: 1234;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 70px;
}

/* toggle theme switch */
.form-check.form-switch {
    display: inline-flex;
    align-items: center;
    padding: 0;
}

.form-check-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle-slider {
    width: 48px;
    height: 22px;
    background-color: var(--bs-primary-bg-subtle);
    border-radius: 16px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    transition: background-color 0.3s;
    margin-right: 10px;
}

.form-check-input:checked + .form-check-label .toggle-slider {
    background-color: var(--bs-link-hover-color);
}

.toggle-icon {
    font-size: 12px;
    color: var(--bs-primary);
    background-color: rgba(240,240,245,.4);
    box-shadow: 2px 0 2px rgba(32,32,32,.25);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

.toggle-icon.fa-sun {
    opacity: 1;
}

.toggle-icon.fa-moon {
    opacity: 0;
}

.form-check-input:checked + .form-check-label .fa-sun {
    opacity: 0;
}

.form-check-input:checked + .form-check-label .fa-moon {
    opacity: 1;
}

[data-bs-theme="dark"] .toggle-slider {
    background-color: var(--bs-light-text-emphasis);
}

[data-bs-theme="dark"] .form-check-input:checked + .form-check-label .toggle-slider {
    background-color: #6ea8fe;
}

[data-bs-theme="dark"] .toggle-icon {
    color: #adb5bd;
    background-color: rgba(32,32,32,.15);
    box-shadow: unset;
}

[data-bs-theme="dark"] .form-check-input:checked + .form-check-label .fa-moon {
    color: #f8f9fa;
}

#themeLabel {
    font-size: 0;
}

/* Navigation */
.header .navbar {
    padding: 14px 32px;
}
.navbar-brand i {
    font-size: 1.5rem;
}
.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
    text-transform: uppercase;
    transition: var(--transition);
}

.navbar-brand:hover {
    opacity: .9;
}

.header .nav-link {
    color: #fff;
    transition: var(--transition);
}

.header .nav-link:hover {
    opacity: .9;
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
}

.header-user-name .fa-user-circle {
    font-size: 1.5rem;
}

/* Sidebar */
.sidebar {
    flex: 0 0 320px;
    background-color: var(--bs-tertiary-bg);
    border-right: 1px solid var(--bs-border-color);
    height: 100%;
}

.user-info {
    background-color: var(--bs-body-bg);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 0 0 1rem 0;
}

.user-info .fw-bold {
    font-size: 1.1rem;
    color: var(--bs-light-text-emphasis);
}

.user-info .fa-user-circle {
    color: var(--color-blue-white);
}

/* Navigation Pills */
.nav-pills .nav-link {
    color: var(--bs-light-text-emphasis);
    border-radius: 0.25rem;
    margin: 0.25rem 0;
    transition: var(--transition);
}

.nav-pills .nav-link:hover {
    background-color: var(--bs-body-bg);
    color: var(--bs-link-hover-color);
}

.nav-pills .nav-link.active {
    background-color: var(--bs-link-color);
    color: white;
}

.nav-pills .nav-link i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
}

/* Breadcrumb */
.breadcrumb-custom {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-custom .breadcrumb-item a {
    color: var(--bs-light-text-emphasis);
    text-decoration: none;
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb-custom .breadcrumb-item a:hover {
    color: var(--bs-link-hover-color);
}

.breadcrumb-item a i {
    font-size: .65rem;
}

/* Cards */
.card {
    transition: var(--transition);
}

.card-header {
    font-weight: 600;
}

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

.btn-group {
    background-color: var(--bs-tertiary-bg);
}

[data-bs-theme=dark] .btn-outline-primary {
    background-color: #dee2e6;
}
[data-bs-theme=dark] .btn-outline-primary:hover {
    background-color: rgba(222, 226, 230, 0.7);
}
.btn-outline-primary {
    background-color: #cfe2ff;
}
.btn-outline-primary:hover {
    background-color: rgba(207, 226, 255, 0.7);
}

/* Tables */
.table {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table th {
    border-top: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
}

.table td {
    vertical-align: middle;
}

/* Alerts */
.alert {
    border-radius: 0.5rem;
    border: none;
    font-weight: 500;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Badges */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
}

/* Forms */
.form-control {
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.form-label,
.card-body .form-text {
    font-size: .75rem;
}

.form-select {
    border-radius: 0.375rem;
}

#sendForm .row {
    gap: 8px 0;
}

#sendForm h6 {
    padding-bottom: 8px;
}

/* Modal */
.modal-content {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-radius: 0.75rem 0.75rem 0 0;
}

.modal-title {
    font-weight: 600;
    color: var(--bs-light-text-emphasis);
}

/* Pagination */
.pagination .page-link {
    border-radius: 0.375rem;
    margin: 0 0.125rem;
    transition: all 0.3s ease;
}

/* Footer */
.footer {
    background-color: var(--bs-tertiary-bg);
    border-top: 1px solid var(--bs-border-color);
    padding: 16px 32px;
    margin: 0;
}

/* Statistics Cards */
.statistics-card {
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    padding: 1rem 0;
    margin-bottom: .75rem;
    transition: all 0.3s ease;
}

.statistics-card:hover {
    transform: scale(1.05);
}

.statistics-card.bg-primary {
    background: linear-gradient(135deg, var(--bs-link-hover-color) 0%, var(--bs-link-color) 100%) !important;
}

.statistics-card.bg-success {
    background: linear-gradient(135deg, #198754 0%, #157347 100%) !important;
}

.statistics-card.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffca2c 100%) !important;
}

.statistics-card.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #bb2d3b 100%) !important;
}

/* Loading States */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        display: none !important;
    }

    .main-content {
        padding: 0.5rem !important;
    }

    .card {
        margin-bottom: 1rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }

    .btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* Dark Mode Support */
/*@media (prefers-color-scheme: dark) {
    .bg-light {
        background-color: #212529 !important;
    }

    .card {
        background-color: #343a40;
        border-color: var(--bs-light-text-emphasis);
    }

    .table {
        background-color: #343a40;
        color: #fff;
    }

    .table th {
        background-color: var(--bs-light-text-emphasis);
        color: #fff;
    }

    .sidebar {
        background-color: #343a40;
        border-color: var(--bs-light-text-emphasis);
    }

    .user-info {
        background: linear-gradient(135deg, #343a40 0%, var(--bs-light-text-emphasis) 100%);
    }
}*/

/* Utility Classes */
.text-gradient-primary {
    background: linear-gradient(135deg, var(--bs-link-hover-color) 0%, #0b5ed7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.shadow-soft {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow-hover {
    transition: box-shadow 0.3s ease;
}

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

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Print Styles */
@media print {
    .navbar,
    .sidebar,
    footer,
    .btn,
    .alert {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
}