/* Buttons and Menu Enhancements */

/* ========== Enhanced Button Styles ========== */

/* Base Button */
.btn {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Ripple Effect */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
    transition: width 0s, height 0s;
}

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* Success Button */
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Warning Button */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

/* Danger Button */
.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Info Button */
.btn-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-info:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Secondary Button */
.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    box-shadow: 0 6px 20px rgba(107, 114, 128, 0.4);
}

/* Light Button */
.btn-light {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    color: #374151;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.btn-light:hover {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Dark Button */
.btn-dark {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(31, 41, 55, 0.3);
}

.btn-dark:hover {
    background: linear-gradient(135deg, #111827 0%, #030712 100%);
    box-shadow: 0 6px 20px rgba(31, 41, 55, 0.4);
}

/* Outline Buttons */
.btn-outline-primary {
    background: transparent;
    color: #6366f1;
    border: 2px solid #6366f1;
    box-shadow: none;
}

.btn-outline-primary:hover {
    background: #6366f1;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-outline-success {
    background: transparent;
    color: #10b981;
    border: 2px solid #10b981;
    box-shadow: none;
}

.btn-outline-success:hover {
    background: #10b981;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-outline-danger {
    background: transparent;
    color: #ef4444;
    border: 2px solid #ef4444;
    box-shadow: none;
}

.btn-outline-danger:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Button Sizes */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
    border-radius: 0.625rem;
}

/* Button with Icon */
.btn i {
    font-size: 1.125rem;
}

.btn-sm i {
    font-size: 1rem;
}

.btn-lg i {
    font-size: 1.25rem;
}

/* Disabled Button */
.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Button Group */
.btn-group .btn {
    border-radius: 0;
    margin-right: -1px;
}

.btn-group .btn:first-child {
    border-radius: 0.5rem 0 0 0.5rem;
}

.btn-group .btn:last-child {
    border-radius: 0 0.5rem 0.5rem 0;
    margin-right: 0;
}

/* ========== Secondary Menu (Sub-menu) Enhancements ========== */

/* Sidebar Menu Base */
#sidebar-menu {
    padding: 0.5rem 0;
}

#sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Main Menu Items */
#sidebar-menu > ul > li > a {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    border-radius: 0.5rem;
    margin: 0.25rem 0.75rem;
    position: relative;
    overflow: hidden;
}

#sidebar-menu > ul > li > a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%);
    transform: scaleY(0);
    transition: transform 0.3s;
}

#sidebar-menu > ul > li > a:hover {
    background: rgba(99, 102, 241, 0.1);
    color: white;
    padding-left: 1.75rem;
}

#sidebar-menu > ul > li > a:hover::before {
    transform: scaleY(1);
}

#sidebar-menu > ul > li.mm-active > a {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    color: white;
}

#sidebar-menu > ul > li.mm-active > a::before {
    transform: scaleY(1);
}

/* Menu Icons */
#sidebar-menu > ul > li > a i {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    width: 1.5rem;
    text-align: center;
    transition: all 0.3s;
}

#sidebar-menu > ul > li > a:hover i {
    transform: scale(1.1);
}

/* Sub-menu (Secondary Menu) */
.sub-menu {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    margin: 0.5rem 0.75rem;
    padding: 0.5rem 0;
    overflow: hidden;
}

.sub-menu li {
    position: relative;
}

.sub-menu li a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
    border-radius: 0.375rem;
    margin: 0.125rem 0.5rem;
    position: relative;
}

/* Sub-menu Item Indicator */
.sub-menu li a::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.3s;
}

.sub-menu li a:hover::before {
    background: #6366f1;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
    transform: translateY(-50%) scale(1.5);
}

.sub-menu li a:hover {
    background: rgba(99, 102, 241, 0.15);
    color: white;
    padding-left: 2.75rem;
}

.sub-menu li.active a,
.sub-menu li a.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    color: white;
    font-weight: 600;
}

.sub-menu li.active a::before,
.sub-menu li a.active::before {
    background: #6366f1;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
}

/* Sub-menu Animation */
.mm-collapse {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mm-collapse.mm-show {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Arrow Indicator for Menu with Sub-menu */
#sidebar-menu > ul > li.has-arrow > a::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 1.5rem;
    transition: transform 0.3s;
}

#sidebar-menu > ul > li.has-arrow.mm-active > a::after {
    transform: rotate(180deg);
}

/* Menu Divider */
.menu-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    margin: 0.75rem 1.5rem;
}

/* Menu Title */
.menu-title {
    padding: 0.75rem 1.5rem 0.5rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Waves Effect */
.waves-effect {
    position: relative;
    overflow: hidden;
}

.waves-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.waves-effect:active::after {
    width: 200px;
    height: 200px;
    transition: width 0s, height 0s;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    #sidebar-menu > ul > li > a {
        padding: 0.75rem 1rem;
        margin: 0.25rem 0.5rem;
    }

    .sub-menu {
        margin: 0.5rem 0.5rem;
    }

    .sub-menu li a {
        padding: 0.625rem 0.75rem 0.625rem 2rem;
    }
}
