/*
 * SIGMA 2.0 - Premium Design System
 * Custom CSS for premium look & feel
 ******************************************************************************/

/* ========================================
   1. CSS VARIABLES & ROOT
   ======================================== */
:root {
    --sigma-primary: #0284c7;
    --sigma-primary-dark: #0369a1;
    --sigma-secondary: #8592a3;
    --sigma-success: #71dd37;
    --sigma-info: #03c3ec;
    --sigma-warning: #ffab00;
    --sigma-danger: #ff3e1d;

    --gradient-primary: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    --gradient-info: linear-gradient(135deg, #03c3ec 0%, #4dd4f0 100%);
    --gradient-success: linear-gradient(135deg, #71dd37 0%, #8ce85d 100%);
    --gradient-warning: linear-gradient(135deg, #ffab00 0%, #ffc233 100%);
    --gradient-danger: linear-gradient(135deg, #ff3e1d 0%, #ff6347 100%);
    --gradient-dark: linear-gradient(135deg, #233446 0%, #3a5068 100%);
    --gradient-hero-admin: linear-gradient(135deg, #0284c7 0%, #1e40af 100%);
    --gradient-hero-guru: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --gradient-hero-kurikulum: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%);
    --gradient-hero-kepsek: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);

    --shadow-card: 0 2px 6px 0 rgba(67, 89, 113, 0.08);
    --shadow-card-hover: 0 8px 25px 0 rgba(67, 89, 113, 0.12);
    --shadow-elevated: 0 12px 40px 0 rgba(67, 89, 113, 0.16);

    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;

    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========================================
   2. GLOBAL ENHANCEMENTS
   ======================================== */
body {
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth page transition */
.layout-page {
    animation: fadeInUp 0.4s ease-out;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

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

/* ========================================
   3. SIDEBAR / MENU OVERHAUL
   ======================================== */
.layout-menu {
    background: linear-gradient(180deg, #233446 0%, #1a2635 100%) !important;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.layout-menu .menu-inner {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for sidebar */
.layout-menu .menu-inner::-webkit-scrollbar {
    width: 4px;
}
.layout-menu .menu-inner::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
.layout-menu .menu-inner::-webkit-scrollbar-track {
    background: transparent;
}

.layout-menu .menu-inner > .menu-item > .menu-link {
    transition: var(--transition-smooth);
    border-radius: 0.5rem;
    margin: 2px 12px;
    padding: 0.625rem 1rem;
}

.layout-menu .menu-inner > .menu-item > .menu-link:hover {
    background: rgba(2, 132, 199, 0.12);
    transform: translateX(4px);
}

.layout-menu .menu-inner > .menu-item.active > .menu-link {
    background: var(--gradient-primary) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
    border-radius: 0.5rem;
    margin: 2px 12px;
}

.layout-menu .menu-inner > .menu-item.active > .menu-link .menu-icon,
.layout-menu .menu-inner > .menu-item.active > .menu-link div {
    color: #fff !important;
}

/* Sidebar Brand */
.app-brand.demo {
    padding: 1.25rem 1.5rem !important;
}

.sigma-brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.sigma-brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
    flex-shrink: 0;
}

.sigma-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sigma-brand-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #d1d5db;
    letter-spacing: 1px;
}

.sigma-brand-sub {
    font-size: 0.65rem;
    color: #8592a3;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Menu Header */
.menu-header .menu-header-text {
    font-size: 0.68rem !important;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    opacity: 0.5;
}

/* ========================================
   4. NAVBAR PREMIUM
   ======================================== */
.layout-navbar {
    backdrop-filter: blur(10px) !important;
    background: rgba(255, 255, 255, 0.85) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.navbar-greeting {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.navbar-greeting-text {
    font-size: 0.8rem;
    color: #8592a3;
}

.navbar-greeting-date {
    font-size: 0.72rem;
    color: #a1acb8;
}

.navbar-nav .dropdown-menu {
    border: none;
    box-shadow: var(--shadow-elevated);
    border-radius: var(--border-radius-lg);
    animation: slideDown 0.2s ease-out;
}

/* ========================================
   5. CARDS PREMIUM
   ======================================== */
.card {
    border: none !important;
    border-radius: var(--border-radius-lg) !important;
    box-shadow: var(--shadow-card);
    transition: var(--transition-smooth);
    overflow: hidden;
}

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

/* Hero/Welcome Cards */
.sigma-hero-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-xl) !important;
    color: #fff;
    min-height: 140px;
}

.sigma-hero-card .card-body {
    position: relative;
    z-index: 2;
}

.sigma-hero-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    z-index: 1;
}

.sigma-hero-card::after {
    content: '';
    position: absolute;
    bottom: -40%;
    right: 5%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    z-index: 1;
}

.sigma-hero-admin { background: var(--gradient-hero-admin); }
.sigma-hero-guru { background: var(--gradient-hero-guru); color: #233446 !important; }
.sigma-hero-guru .card-title,
.sigma-hero-guru h5,
.sigma-hero-guru p,
.sigma-hero-guru .badge { color: #233446 !important; }
.sigma-hero-kurikulum { background: linear-gradient(135deg, #0ea5e9 0%, #1d4ed8 100%); }
.sigma-hero-kepsek { background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%); }

/* Stat Cards */
.sigma-stat-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-lg) !important;
    transition: var(--transition-bounce);
}

.sigma-stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-elevated);
}

.sigma-stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    transition: var(--transition-smooth);
}

.sigma-stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(-3deg);
}

.sigma-stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
    animation: countUp 0.6s ease-out;
}

.sigma-stat-card .stat-label {
    font-size: 0.8rem;
    color: #8592a3;
    font-weight: 500;
}

.stat-icon.primary { background: rgba(2, 132, 199, 0.12); color: var(--sigma-primary); }
.stat-icon.info { background: rgba(3, 195, 236, 0.12); color: var(--sigma-info); }
.stat-icon.success { background: rgba(113, 221, 55, 0.12); color: var(--sigma-success); }
.stat-icon.warning { background: rgba(255, 171, 0, 0.12); color: var(--sigma-warning); }
.stat-icon.danger { background: rgba(255, 62, 29, 0.12); color: var(--sigma-danger); }

/* Quick Action Cards */
.sigma-quick-action {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-lg);
    background: #fff;
    border: 1px solid rgba(0,0,0,0.04);
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.sigma-quick-action:hover {
    background: rgba(2, 132, 199, 0.04);
    border-color: rgba(2, 132, 199, 0.2);
    transform: translateX(4px);
    color: inherit;
}

.sigma-quick-action .action-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.sigma-quick-action .action-text {
    display: flex;
    flex-direction: column;
}

.sigma-quick-action .action-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.sigma-quick-action .action-desc {
    font-size: 0.75rem;
    color: #8592a3;
}

/* ========================================
   6. TABLE ENHANCEMENTS
   ======================================== */
.table > thead > tr > th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #566a7f;
    border-bottom: 2px solid #e9ecef !important;
    padding: 0.875rem 1.25rem;
}

.table > tbody > tr {
    transition: var(--transition-smooth);
}

.table > tbody > tr:hover {
    background: rgba(2, 132, 199, 0.02);
}

.table > tbody > tr > td {
    padding: 0.875rem 1.25rem;
    vertical-align: middle;
}

/* Empty State */
.sigma-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #a1acb8;
}

.sigma-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.sigma-empty-state h6 {
    color: #697a8d;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.sigma-empty-state p {
    font-size: 0.85rem;
    color: #a1acb8;
    max-width: 300px;
    margin: 0 auto;
}

/* ========================================
   7. BADGE ENHANCEMENTS
   ======================================== */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* Status badges with dot indicator */
.sigma-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.35em 0.85em;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 500;
}

.sigma-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sigma-status.approved {
    background: rgba(113, 221, 55, 0.12);
    color: #56ca00;
}

.sigma-status.approved::before {
    background: #56ca00;
}

.sigma-status.pending {
    background: rgba(255, 171, 0, 0.12);
    color: #e09200;
}

.sigma-status.pending::before {
    background: #e09200;
    animation: pulse 1.5s infinite;
}

/* ========================================
   8. BUTTON ENHANCEMENTS
   ======================================== */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition-smooth);
    letter-spacing: 0.2px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 5px 15px rgba(2, 132, 199, 0.4);
}

.btn-danger {
    box-shadow: 0 3px 10px rgba(255, 62, 29, 0.3);
}

.btn-success {
    box-shadow: 0 3px 10px rgba(113, 221, 55, 0.3);
}

/* ========================================
   9. MODAL ENHANCEMENTS
   ======================================== */
.modal-content {
    border: none;
    border-radius: var(--border-radius-xl) !important;
    box-shadow: var(--shadow-elevated);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.5rem;
}

/* ========================================
   10. ALERT ENHANCEMENTS
   ======================================== */
.alert {
    border: none;
    border-radius: var(--border-radius-lg);
    animation: slideDown 0.4s ease-out;
    font-size: 0.875rem;
}

.alert-success {
    background: rgba(113, 221, 55, 0.12);
    color: #56ca00;
    border-left: 4px solid #71dd37;
}

.alert-danger {
    background: rgba(255, 62, 29, 0.12);
    color: #e8381a;
    border-left: 4px solid #ff3e1d;
}

/* ========================================
   11. FORM ENHANCEMENTS
   ======================================== */
.form-control,
.form-select {
    border-radius: 8px;
    border-color: #dbdfe5;
    padding: 0.55rem 0.875rem;
    transition: var(--transition-smooth);
    font-size: 0.9rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--sigma-primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.form-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: #566a7f;
    margin-bottom: 0.35rem;
}

/* ========================================
   12. CARD HEADER ENHANCEMENTS
   ======================================== */
.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    padding: 1.25rem 1.5rem;
}

.card-header h5 {
    font-weight: 600;
    font-size: 1rem;
    color: #233446;
}

/* ========================================
   13. FOOTER
   ======================================== */
.content-footer {
    font-size: 0.8rem;
    color: #a1acb8;
}

/* ========================================
   14. PAGE TITLE / BREADCRUMB
   ======================================== */
.sigma-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.sigma-page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #233446;
    margin: 0;
}

.sigma-page-title span {
    font-weight: 400;
    color: #8592a3;
}

/* ========================================
   15. SCROLLBAR STYLING
   ======================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #c4c4c4;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ========================================
   16. LOADING SHIMMER EFFECT
   ======================================== */
.sigma-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* ========================================
   17. ROW ANIMATIONS
   ======================================== */
.row > [class*="col-"] {
    animation: fadeInUp 0.4s ease-out both;
}

.row > [class*="col-"]:nth-child(1) { animation-delay: 0s; }
.row > [class*="col-"]:nth-child(2) { animation-delay: 0.05s; }
.row > [class*="col-"]:nth-child(3) { animation-delay: 0.1s; }
.row > [class*="col-"]:nth-child(4) { animation-delay: 0.15s; }
.row > [class*="col-"]:nth-child(5) { animation-delay: 0.2s; }
.row > [class*="col-"]:nth-child(6) { animation-delay: 0.25s; }

/* ========================================
   18. RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (max-width: 767.98px) {
    .sigma-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .sigma-hero-card {
        min-height: auto;
    }

    .sigma-stat-card .stat-value {
        font-size: 1.4rem;
    }

    .navbar-greeting {
        display: none;
    }
}

/* ========================================
   19. NOTIFICATION DOT (for future use)
   ======================================== */
.sigma-notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sigma-danger);
    border: 2px solid #fff;
}

/* ========================================
   20. DATA TABLE SEARCH
   ======================================== */
.sigma-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.sigma-search-box {
    position: relative;
    max-width: 280px;
    width: 100%;
}

.sigma-search-box input {
    padding-left: 2.5rem;
    border-radius: 20px;
    background: #f8f9fa;
    border: 1px solid transparent;
    font-size: 0.85rem;
}

.sigma-search-box input:focus {
    background: #fff;
    border-color: var(--sigma-primary);
}

.sigma-search-box .search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a1acb8;
    font-size: 1rem;
}

/* ========================================
   21. AVATAR ENHANCEMENTS
   ======================================== */
.avatar img {
    width: 40px !important;
    height: 40px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

.avatar-online::after {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(113, 221, 55, 0.3) !important;
}

/* ========================================
   22. CONFIRM DELETE MODAL STYLES
   ======================================== */
.sigma-delete-confirm {
    text-align: center;
    padding: 1rem 0;
}

.sigma-delete-confirm i {
    font-size: 3rem;
    color: var(--sigma-danger);
    margin-bottom: 1rem;
}
