/* ==================== */
/*      BASE STYLES     */
/* ==================== */
/* Google Fonts - Rubik */
@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Rubik", sans-serif;
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

html, body {
    min-height: 100vh;
}

html {
    background-color: #000000;
    transition: background-color 0.4s ease;
    color: #ffffff;
}

body {
    background-color: transparent;
}

.main-container {
    display: flex;
    min-height: 100vh;
}

/* ==================== */
/*      TRANSITIONS     */
/* ==================== */
.sidebar,
.sidebar-header h1,
.nav-link,
.nav-icon,
.nav-label,
.card,
.card-header,
.list-group-item,
.alert,
.dropdown-menu,
.dropdown-item,
.modal-content,
.table,
.input-group-text,
.page-link,
.accordion,
.form-control,
.form-select,
.btn,
.dropzone,
.text-default,
.text-body {
    transition: all 0.4s ease;
}

/* ==================== */
/*      SIDEBAR         */
/* ==================== */
.sidebar {
    width: 310px;
    margin: 16px;
    border-radius: 16px;
    border: 1px solid #333333; 
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    background: #111111;
    height: calc(100vh - 32px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    color: white;
    z-index: 1000;
}

/* Collapsed State */
.sidebar.collapsed {
    width: 90px;
}

.sidebar.collapsed .logo-title-container {
    opacity: 0;
    max-width: 0;
    pointer-events: none;
}

.sidebar.collapsed .sidebar-nav .nav-link .nav-label {
    opacity: 0;
    pointer-events: none;
}

/* Mobile State */
.sidebar.mobile {
    z-index: 1000;
    overflow-y: hidden;
}

.sidebar.mobile-collapsed {
    overflow-y: hidden;
}

.sidebar.hide-content .sidebar-bottom {
    visibility: hidden;
}

/* ==================== */
/*   SIDEBAR HEADER     */
/* ==================== */
.sidebar-header {
    position: relative;
    padding: 9.5px 20px 7.5px;
    flex: 0 0 auto;
}

.sidebar-top {
    display: flex;
    align-items: center;
    min-height: 50px;
}

/* Toggle Button */
.sidebar-toggler {
    position: absolute;
    left: 20px;
    height: 50px;
    width: 50px;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    outline: none;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s ease;
}

.sidebar-toggler:hover {
    background: #333333;
    border-radius: 10px;
}

.sidebar-toggler span {
    font-size: 1.75rem;
}

/* Logo & Title Container */
.logo-title-container {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 60px;
    transition: all 0.4s ease;
    overflow: hidden;
}

.header-link {
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header h1 {
    color: #FFFFFF;
    font-size: 1.5rem;
    white-space: nowrap;
    margin: 0;
    transition: color 0.4s ease, opacity 0.4s ease, max-width 0.4s ease;
}

/* ==================== */
/*   SIDEBAR NAVIGATION */
/* ==================== */
.sidebar-bottom {
    display: flex;
    flex-grow: 1;
    justify-content: space-between;
    flex-direction: column;
    padding: 7.5px 0 9.5px 0;
    overflow-y: auto;
    scrollbar-width: none;
}

.sidebar-bottom::-webkit-scrollbar {
    display: none;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0 20px;
}

.primary-nav {
    margin-bottom: 11px;
}

.nav-link {
    color: #FFFFFF;
    display: flex;
    align-items: center;
    height: 50px;
    border-radius: 10px;
    padding-left: 13px;
    margin-top: 2.5px;
    margin-bottom: 2.5px;
    text-decoration: none;
    white-space: nowrap;
    width: 100%;
}

.nav-link:hover {
    background: #333333;
}

.nav-link.active {
    background: #0d6efd;
}

.nav-icon {
    font-size: 1.5rem;
    min-width: 24px;
    display: flex;
    justify-content: center;
}

.nav-label {
    width: auto;
    padding-left: 10px;
    transition: all 0.4s ease;
}

.aside-hr {
    background-color: #333333;
    height: 2px;
    border: 0;
    margin-bottom: 11px;
    margin-left: 0;
    margin-right: 0;
    transition: background-color 0.4s ease;
}

/* ========================= */
/*      RIGHT CONTAINER      */
/* ========================= */
.right-container {
    display: flex;
    flex-direction: column;
    flex: 1; 
    padding: 16px;
    min-height: calc(100vh - 32px); 
    position: relative;
    color: inherit;
}


.content-container {
    color: inherit;
}

.footer-container {
    margin-top: auto;
    width: 100%;
}

.footer {
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
    padding: 20px 0;
    width: 100%;
    transition: color 0.4s ease;
}

/* Search Container */
.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.search-form {
    background: transparent;
    width: 100%;
    max-width: 1000px;
    height: 60px;
    border-radius: 30px;
    border: 2px solid #333333;
    display: flex;
    justify-content: center;
    flex-direction: row;
    align-items: center;
    padding: 0 20px;
    transition: border-color 0.4s ease;
}

.search-form .form-control {
    color: #FFFFFF;
    flex-grow: 1;
    background: transparent;
    border: none;
    padding: 8px;
    outline: none;
    font-size: 16px;
    transition: color 0.4s ease;
}

.search-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.4s ease;
}

/* Drag and Drop Area */
.dropzone {
    color: #ffffff;
    transition: all 0.4s ease;
}

.dropzone p,
.dropzone .text-muted {
    color: inherit;
    transition: color 0.4s ease;
}

/* ==================== */
/*   CARD BODY SHADOW   */
/* ==================== */
.card-body {
    color: inherit;
    border-radius: 16px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    margin: -1px; 
}

/* Light mode adjustment */
html.light-mode .card-body {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}



/* ========================== */
/*      Bootstrap Override    */
/* ========================== */
/* Form controls */
.form-control, .form-select, .form-control:focus, .form-select:focus {
    background-color: #333333;
    border-color: #555555;
    color: #FFFFFF;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Buttons */
.btn {
    color: #FFFFFF;
}

.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-outline-secondary {
    color: #FFFFFF;
    border-color: #555555;
}

.btn-outline-secondary:hover {
    background-color: #333333;
    border-color: #555555;
}

/* H4 QR-Title */
.qr-title {
    color: #FFFFFF;
}


/* Cards */
.card {
    background-color: #111111;
    border-color: #333333;
    color: #FFFFFF;
    border-radius: 16px;
}

.card-header {
    background-color: #222222;
    border-bottom-color: #333333;
    color: #FFFFFF;
}

/* List groups */
.list-group-item {
    background-color: #111111;
    border-color: #333333;
    color: #FFFFFF;
}

.list-group-item:hover {
    background-color: #222222;
}

/* Alerts */
.alert {
    background-color: #222222;
    border-color: #333333;
    color: #FFFFFF;
    border-radius: 16px;
}

/* Navs */
.nav-tabs {
    display: flex;
    gap: 10px;
    border-bottom: none;
}

.nav-tabs .nav-link {
    border: 1px solid #333333;
    margin-right: 4px;
}

.nav-tabs .nav-link.active {
    background-color: #0d6efd;
    color: #111111;
    border: none;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-center {
    color: #FFFFFF;
}

/* Dropdowns */
.dropdown-menu {
    background-color: #111111;
    border-color: #333333;
}

.dropdown-item {
    color: #FFFFFF;
}

.dropdown-item:hover {
    background-color: #333333;
    color: #FFFFFF;
}

/* Modal */
.modal-content {
    background-color: #111111;
    border-color: #333333;
    color: #FFFFFF;
}

.modal-header, .modal-footer {
    border-color: #333333;
}

/* Tooltips */
.tooltip {
    --bs-tooltip-bg: #333333;
}

/* Popovers */
.popover {
    --bs-popover-bg: #111111;
    --bs-popover-border-color: #333333;
    --bs-popover-header-bg: #222222;
    --bs-popover-header-color: #FFFFFF;
    --bs-popover-body-color: #FFFFFF;
}

/* Progress bars */
.progress {
    background-color: #333333;
}

/* Tables */
.table {
    --bs-table-color: #FFFFFF;
    --bs-table-bg: transparent;
    --bs-table-border-color: #333333;
    --bs-table-striped-bg: rgba(51, 51, 51, 0.5);
    --bs-table-hover-bg: rgba(51, 51, 51, 0.75);
}

/* Input group text */
.input-group-text {
    background-color: #333333;
    border-color: #555555;
    color: #FFFFFF;
}

/* Pagination */
.page-link {
    background-color: #111111;
    border-color: #333333;
    color: #FFFFFF;
}

.page-link:hover {
    background-color: #333333;
    border-color: #333333;
    color: #FFFFFF;
}

.page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* Badges */
.badge {
    color: #FFFFFF;
}

/* Accordion */
.accordion {
    --bs-accordion-bg: #111111;
    --bs-accordion-border-color: #333333;
    --bs-accordion-btn-color: #FFFFFF;
    --bs-accordion-btn-bg: #222222;
    --bs-accordion-active-color: #FFFFFF;
    --bs-accordion-active-bg: #333333;
    --bs-accordion-btn-focus-box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    --bs-accordion-body-padding-x: 1.25rem;
    --bs-accordion-body-padding-y: 1rem;
    --bs-accordion-btn-padding-x: 1.25rem;
    --bs-accordion-btn-padding-y: 1rem;
    --bs-accordion-color: #FFFFFF;
}

/* Custom form controls */
.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}



/* Text colors */
.text-muted {
    color: #aaaaaa !important;
}

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-info {
    color: #17a2b8 !important;
}

.text-white {
    color: #ffffff !important;
}

.text-default {
    color: inherit;
}

.text-body {
    color: inherit;
}

/* Background colors */
.bg-primary {
    background-color: #0d6efd !important;
}

.bg-success {
    background-color: #28a745 !important;
}

.bg-danger {
    background-color: #dc3545 !important;
}

.bg-warning {
    background-color: #ffc107 !important;
}

.bg-info {
    background-color: #17a2b8 !important;
}

/* Links */
a {
    color: #0d6efd;
    text-decoration: none;
    transition: color 0.4s ease;
}

a:hover {
    text-decoration: none;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #111111;
    transition: background 0.4s ease;
}

::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 4px;
    transition: background 0.4s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #444444;
}

/* ==================== */
/*     RESPONSIVE       */
/* ==================== */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar.mobile:not(.mobile-collapsed) {
        height: 50vh !important;
        max-height: 50vh;
        overflow-y: auto;
    }

    .sidebar {
        width: calc(100% - 32px);
        height: 69px;
        margin: 16px 16px 0 16px;
    }
    
    .right-container {
        min-height: calc(100vh - 69px);
        padding-top: 88px;
    }
    
    .content-container {
        flex: 1;
    }

    .search-container {
        margin: 0 16px 16px 16px;
        width: calc(100% - 32px);
    }
    
    .search-form {
        width: 100%;
    }
}

/* ==================== */
/*      THEME TOGGLE    */
/* ==================== */
.theme-toggle-container {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.theme-toggler {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 100%;
    text-align: left;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50px;
    border-radius: 10px;
    margin-top: 2.5px;
    margin-bottom: 11px;
    transition: all 0.3s ease;
}

.theme-toggler:hover {
    background: rgba(255, 255, 255, 0.1);
}

.theme-icon {
    font-size: 1.25rem;
}


/* ==================== */
/*      UPLOAD AREA     */
/* ==================== */
.upload-area {
    border: 2px dashed #555555; 
    border-radius: 10px;
    padding: 20px;
    transition: all 0.4s ease;
}
/* Hover state for upload area */
.upload-area:hover {
    border-color: #0d6efd;
}

/* Active/drag state for upload area */
.upload-area.drag-over {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
}




/* ==================== */
/*      LIGHT MODE      */
/* ==================== */
html.light-mode {
    background-color: #f8f9fa;
    color: #212529;
}

html.light-mode body {
    background-color: transparent;
}

/* Text colors in light mode */
html.light-mode .right-container,
html.light-mode .content-container,
html.light-mode .dropzone,
html.light-mode .dropzone p,
html.light-mode .dropzone .text-muted,
html.light-mode .card-body,
html.light-mode .card-body p,
html.light-mode .card-body .text-muted,
html.light-mode .compressor-dropzone,
html.light-mode .compressor-dropzone p,
html.light-mode .compressor-dropzone .text-muted,
html.light-mode .home-content,
html.light-mode .home-content p,
html.light-mode .home-content h1,
html.light-mode .home-content h2,
html.light-mode .home-content h3,
html.light-mode .home-content h4,
html.light-mode .home-content h5,
html.light-mode .home-content h6,
html.light-mode .text-default,
html.light-mode .text-body {
    color: #212529 !important;
}

html.light-mode .text-muted {
    color: #6c757d !important;
}

html.light-mode .text-white {
    color: #212529 !important;
}

/* Sidebar in light mode */
html.light-mode .sidebar {
    background: #ffffff;
    color: #212529;
}

html.light-mode .sidebar-header h1,
html.light-mode .header-link,
html.light-mode .nav-link {
    color: #212529;
    transition: color 0.4s ease, opacity 0.4s ease, max-width 0.4s ease;
}

html.light-mode .nav-link:hover {
    background: #e9ecef;
}

html.light-mode .nav-link.active {
    background: #0d6efd;
    color: white;
}

html.light-mode .aside-hr {
    background-color: #e9ecef;
}

html.light-mode .sidebar-toggler {
    color: #212529;
}

html.light-mode .sidebar-toggler:hover {
    background: #e9ecef;
}

/* Form controls in light mode */
html.light-mode .form-control,
html.light-mode .form-select,
html.light-mode .form-control:focus,
html.light-mode .form-select:focus {
    background-color: #ffffff;
    border-color: #ced4da;
    color: #212529;
}

html.light-mode .form-control::placeholder {
    color: rgba(33, 37, 41, 0.5);
}

/* Cards in light mode */
html.light-mode .card {
    background-color: #ffffff;
    border-color: #e9ecef;
    color: #212529;
}

html.light-mode .card-header {
    background-color: #f8f9fa;
    border-bottom-color: #e9ecef;
}

/* List groups in light mode */
html.light-mode .list-group-item {
    background-color: #ffffff;
    border-color: #e9ecef;
    color: #212529;
}

html.light-mode .list-group-item:hover {
    background-color: #f8f9fa;
}

/* Alerts in light mode */
html.light-mode .alert {
    background-color: #ffffff;
    border-color: #e9ecef;
    color: #212529;
}

/* Dropdowns in light mode */
html.light-mode .dropdown-menu {
    background-color: #ffffff;
    border-color: #e9ecef;
}

html.light-mode .dropdown-item {
    color: #212529;
}

html.light-mode .dropdown-item:hover {
    background-color: #f8f9fa;
}

/* Scrollbar in light mode */
html.light-mode ::-webkit-scrollbar-track {
    background: #f8f9fa;
}

html.light-mode ::-webkit-scrollbar-thumb {
    background: #ced4da;
}

html.light-mode ::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Tables in light mode */
html.light-mode .table {
    --bs-table-color: #212529;
    --bs-table-bg: transparent;
    --bs-table-border-color: #e9ecef;
    --bs-table-striped-bg: rgba(0, 0, 0, 0.02);
    --bs-table-hover-bg: rgba(0, 0, 0, 0.075);
}

/* Input group text in light mode */
html.light-mode .input-group-text {
    background-color: #e9ecef;
    border-color: #ced4da;
    color: #212529;
}

/* Pagination in light mode */
html.light-mode .page-link {
    background-color: #ffffff;
    border-color: #dee2e6;
    color: #0d6efd;
}

html.light-mode .page-link:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #0a58ca;
}

html.light-mode .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

html.light-mode .footer {
    color: #6c757d;
}

html.light-mode .search-form {
    border-color: #ced4da;
}

html.light-mode .search-form .form-control {
    color: #212529;
}

html.light-mode .search-form .form-control::placeholder {
    color: rgba(33, 37, 41, 0.5);
}

html.light-mode a {
    color: #0d6efd;
}
html.light-mode .bi {
    color: #212529 !important;
}

html.light-mode .btn-outline-primary {
    color: #212529 !important;
    border-color: #0d6efd !important;
}

html.light-mode .btn-outline-primary:hover {
    background-color: #0d6efd !important;
    color: white !important;
}

html.light-mode .btn-primary {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: white !important;
}


html.light-mode .theme-toggler:hover {
    background: #e9ecef;
}

html.light-mode .btn-primary:hover {
    background-color: #0b5ed7 !important;
    border-color: #0a58ca !important;
}

/* Specific fix for the cloud upload icon */
html.light-mode .bi-cloud-arrow-up {
    color: #212529 !important;
}

/* Fix for buttons containing icons */
html.light-mode .btn .bi {
    color: inherit !important;
}

/* Ensure all buttons inherit proper colors */
html.light-mode .btn {
    color: inherit;
}

/* Specific fix for YouTube Converter button */
html.light-mode a.btn-primary .bi-download {
    color: white !important;
}

html.light-mode .upload-area {
    border-color: #adb5bd; 
}


html.light-mode .sidebar {
    border-color: #e9ecef; /* Light mode border color */
}

html.light-mode .qr-title {
    color: #212529;
}


/* Loading Modal Styles */
.modal-content {
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.modal-body {
    transition: color 0.4s ease;
}

/* Light mode specific styles for modal */
html.light-mode .modal-content {
    background-color: #ffffff;
    border-color: #e9ecef;
    color: #212529;
}

html.light-mode .modal-body {
    color: #212529;
}

html.light-mode .modal-header,
html.light-mode .modal-footer {
    border-color: #e9ecef;
}

/* Dark mode specific styles for modal */
html:not(.light-mode) .modal-content {
    background-color: #111111;
    border-color: #333333;
    color: #ffffff;
}

html:not(.light-mode) .modal-body {
    color: #ffffff;
}

html:not(.light-mode) .modal-header,
html:not(.light-mode) .modal-footer {
    border-color: #333333;
}