/**
 * SiFast Admin Panel
 * Main Stylesheet
 * 
 * File: assets/css/style.css
 */

/* ======== BASE STYLES ======== */
:root {
    --primary-color: #2c7be5;
    --primary-dark: #1a68d1;
    --primary-light: #d2e3fc;
    --secondary-color: #6c757d;
    --success-color: #00d97e;
    --danger-color: #e63757;
    --warning-color: #f6c343;
    --info-color: #39afd1;
    --dark-color: #12263f;
    --light-color: #f9fbfd;
    --border-color: #e3ebf6;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
    --transition-speed: 0.3s;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f9fafe;
    color: #495057;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

/* ======== PRELOADER ======== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s;
}

#preloader.fade-out {
    opacity: 0;
}

/* ======== LOGIN PAGE ======== */
.login-bg {
    background: linear-gradient(135deg, #2c7be5 0%, #1a68d1 100%);
    background-size: cover;
    background-position: center;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.login-bg::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/pattern.svg');
    opacity: 0.05;
    z-index: 0;
}

.login-container {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 15px 35px rgba(18, 38, 63, 0.15);
    padding: 2.5rem;
    margin: 2rem 0;
    position: relative;
    z-index: 1;
}

.login-logo {
    max-width: 120px;
    height: auto;
    margin-bottom: 1rem;
}

.login-form .form-control {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #e3ebf6;
    background-color: #f9fbfd;
}

.login-form .input-group:focus-within {
    box-shadow: 0 0 0 0.25rem rgba(44, 123, 229, 0.25);
    border-radius: 0.375rem;
}

.login-form .input-group-text {
    background-color: #f9fbfd;
    border: 1px solid #e3ebf6;
    color: #95aac9;
}

/* ======== MAIN LAYOUT ======== */
.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: all var(--transition-speed);
}

.navbar {
    height: var(--header-height);
    padding: 0 1rem;
    box-shadow: 0 0.5rem 1rem rgba(18, 38, 63, 0.05);
    z-index: 1030;
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.main-container {
    display: flex;
    flex: 1;
    margin-top: var(--header-height);
}

/* ======== SIDEBAR STYLES ======== */
.sidebar {
    width: var(--sidebar-width);
    min-height: calc(100vh - var(--header-height));
    background-color: #fff;
    box-shadow: 0 0.5rem 1rem rgba(18, 38, 63, 0.05);
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    z-index: 1020;
    transition: all var(--transition-speed);
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(18, 38, 63, 0.1);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--dark-color);
}

.brand-logo {
    width: 36px;
    height: auto;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    margin-left: 0.75rem;
    transition: opacity var(--transition-speed);
}

.sidebar-user {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.avatar-lg {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.user-info {
    transition: opacity var(--transition-speed);
}

.user-name {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.user-role {
    font-size: 0.75rem;
    font-weight: 500;
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary-color);
    font-weight: 700;
    padding: 1rem 1.5rem 0.5rem;
}

.menu-item {
    position: relative;
    margin: 0.25rem 0;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--secondary-color);
    text-decoration: none;
    transition: all var(--transition-speed);
    border-radius: 0.375rem;
    margin: 0 0.75rem;
}

.menu-icon {
    width: 1.5rem;
    font-size: 1rem;
    text-align: center;
    margin-right: 1rem;
    color: #95aac9;
    transition: all var(--transition-speed);
}

.menu-label {
    flex: 1;
    transition: opacity var(--transition-speed);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-item:hover .menu-link {
    color: var(--primary-color);
    background-color: rgba(44, 123, 229, 0.1);
}

.menu-item:hover .menu-icon {
    color: var(--primary-color);
}

.menu-item.active .menu-link {
    color: var(--primary-color);
    background-color: rgba(44, 123, 229, 0.1);
    font-weight: 600;
}

.menu-item.active .menu-icon {
    color: var(--primary-color);
}

/* ======== CONTENT AREA ======== */
.content {
    flex: 1;
    padding: 1.5rem;
    margin-left: var(--sidebar-width);
    transition: margin var(--transition-speed);
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--dark-color);
}

.page-description {
    color: var(--secondary-color);
    margin-bottom: 0;
}

.content-container {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(18, 38, 63, 0.05);
    padding: 1.5rem;
}

.alert-info {
    opacity: 1 !important; 
    display: block !important;
    visibility: visible !important;
    position: relative !important;
}

.alert-info.animate__animated {
    animation-name: none !important;
}

/* Menghilangkan efek backdrop modal */
.modal-backdrop {
    opacity: 0.5 !important;
    background-color: rgba(0, 0, 0, 0.3) !important;
}

/* Pastikan alert informasi tetap terlihat */
.alert-info {
    position: relative;
    z-index: 1;
    border-left: 4px solid #0dcaf0;
    background-color: rgba(13, 202, 240, 0.1);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Memperbaiki card alert agar animasi tidak memengaruhi tampilan */
.card .alert {
    animation: none !important;
    opacity: 1 !important;
    display: block !important;
}

/* Pastikan konten tidak tertutup saat modal terbuka */
body.modal-open {
    overflow: auto;
    padding-right: 0 !important;
}

/* Perbaikan gaya untuk instruksi */
.alert-info .fa-info-circle {
    color: #0dcaf0;
}

/* Menghilangkan animate__fadeOut pada elemen alert */
.alert.animate__fadeOut {
    animation-name: none !important;
    opacity: 1 !important;
}

/* Memperbaiki jarak antara elemen dalam alert */
.alert ul {
    margin-bottom: 0.5rem;
}

.alert p:last-child {
    margin-bottom: 0;
}

/* Memastikan alert tidak memiliki animasi keluar */
.alert.fade.show {
    opacity: 1 !important;
    transition: none !important;
}

/* ======== FOOTER ======== */
.footer {
    background-color: #fff;
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    margin-left: var(--sidebar-width);
    transition: margin var(--transition-speed);
}

/* ======== SIDEBAR COLLAPSED STATE ======== */
.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .user-info,
.sidebar-collapsed .menu-header,
.sidebar-collapsed .menu-label {
    opacity: 0;
    visibility: hidden;
}

.sidebar-collapsed .menu-link {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar-collapsed .menu-icon {
    margin-right: 0;
    font-size: 1.25rem;
}

.sidebar-collapsed .content,
.sidebar-collapsed .footer {
    margin-left: var(--sidebar-collapsed-width);
}

/* ======== DASHBOARD STYLES ======== */
.stat-card {
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(18, 38, 63, 0.05);
    background-color: #fff;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--primary-color);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--dark-color);
}

.stat-card-label {
    color: var(--secondary-color);
    font-size: 0.875rem;
    margin-bottom: 0;
}

.trend-indicator {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.trend-indicator i {
    margin-right: 0.25rem;
}

/* ======== CARD STYLES ======== */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(18, 38, 63, 0.05);
    margin-bottom: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    box-shadow: 0 0.75rem 2rem rgba(18, 38, 63, 0.1);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background-color: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem 1.5rem;
}

/* ======== FORM STYLES ======== */
.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(44, 123, 229, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(44, 123, 229, 0.25);
}

.input-group-text {
    border: 1px solid var(--border-color);
    background-color: #f9fbfd;
}

/* ======== BUTTON STYLES ======== */
.btn {
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ======== UTILITY CLASSES ======== */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
}

.avatar-initials {
    font-weight: 700;
    text-transform: uppercase;
}

.notification-dropdown {
    min-width: 320px;
    padding: 0;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(18, 38, 63, 0.1);
}

.notification-dropdown .dropdown-header {
    background-color: #f9fbfd;
    padding: 1rem;
    font-weight: 600;
}

.notification-dropdown .dropdown-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-in-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.slide-in-up {
    animation: slideInUp 0.5s ease-in-out;
}

@keyframes slideInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.bounce-in {
    animation: bounceIn 0.5s ease-in-out;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* ======== RESPONSIVE ADJUSTMENTS ======== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .content, .footer {
        margin-left: 0 !important;
    }
    
    .sidebar-collapsed .sidebar {
        transform: translateX(0);
        width: var(--sidebar-width);
    }
    
    .sidebar-collapsed .brand-text,
    .sidebar-collapsed .user-info,
    .sidebar-collapsed .menu-header,
    .sidebar-collapsed .menu-label {
        opacity: 1;
        visibility: visible;
    }
    
    .sidebar-collapsed .menu-link {
        justify-content: flex-start;
        padding: 0.75rem 1.5rem;
    }
    
    .sidebar-collapsed .menu-icon {
        margin-right: 1rem;
        font-size: 1rem;
    }
}

@media (max-width: 767.98px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .page-header .col-auto {
        margin-top: 1rem;
        align-self: flex-start;
    }
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Menu Editor Specific Styles */
.dd {
    position: relative;
    display: block;
    margin: 0;
    padding: 0;
    max-width: 100%;
    list-style: none;
    font-size: 13px;
    line-height: 20px;
}

.dd-list {
    display: block;
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dd-item {
    display: block;
    position: relative;
    margin: 0.5rem 0;
    padding: 0;
    min-height: 20px;
    font-size: 13px;
    line-height: 20px;
}

.dd-handle {
    display: block;
    height: auto;
    margin: 0;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: normal;
    line-height: 1.5;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(18, 38, 63, 0.05);
    color: var(--dark-color);
    cursor: move;
}

.dd-item > button {
    position: relative;
    float: left;
    width: 2rem;
    height: 2rem;
    margin: 0 0.25rem;
    padding: 0;
    text-indent: 100%;
    white-space: nowrap;
    overflow: hidden;
    border: 0;
    background: transparent;
    line-height: 1;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
}

.dd-item > button:before {
    display: block;
    position: absolute;
    width: 100%;
    text-align: center;
    text-indent: 0;
    font-family: 'Font Awesome 6 Free';
    content: '\f067';
}

.dd-item > button[data-action="collapse"]:before {
    content: '\f068';
}

.dd-actions {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

/* Media Manager Specific Styles */
.media-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1.5rem rgba(18, 38, 63, 0.1);
}

.media-preview img {
    max-height: 150px;
    object-fit: contain;
}

/* Log Viewer Specific Styles */
.log-card {
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.log-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.log-container {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.375rem;
    background-color: #f8f9fa;
}

.log-entry {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: background-color 0.2s;
}

.log-entry:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

/* Backup Manager Specific Styles */
.backup-action-card {
    padding: 1.5rem;
    text-align: center;
    height: 100%;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.backup-action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
}