/* =====================================
   Bullionet Additional Styles
   Extra modern components & improvements
   ===================================== */

/* Root Page Improvements */
.root-boxes .root-box {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.root-boxes .root-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(59, 130, 246, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.root-boxes .root-box:hover::before {
    opacity: 1;
}

.root-boxes .root-box:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    border-color: var(--bullionet-accent) !important;
}

.root-boxes .root-box .icon-wrapper {
    transition: all 0.3s ease;
}

.root-boxes .root-box:hover .icon-wrapper {
    transform: scale(1.1) rotate(5deg);
}

.root-boxes .root-box .badge {
    transition: all 0.3s ease;
}

.root-boxes .root-box:hover .badge {
    transform: translateX(5px);
}

/* Dashboard Improvements */
.section-dashboard .card {
    transition: all 0.3s ease;
}

.section-dashboard .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

/* Table Improvements */
.table-hover tbody tr {
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background: var(--bullionet-bg-tertiary) !important;
    transform: scale(1.01);
}

/* Gradient Backgrounds */
.gradient-primary {
    background: linear-gradient(135deg, var(--bullionet-accent) 0%, var(--bullionet-accent-hover) 100%);
}

.gradient-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.gradient-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.gradient-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

/* Card Headers with Icons */
.card-header i.material-icons {
    font-size: 24px;
}

/* Better Spacing */
.g-4 {
    gap: 1.5rem;
}

/* Text Styles */
.text-gradient-primary {
    background: linear-gradient(135deg, var(--bullionet-accent-light) 0%, var(--bullionet-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Button Enhancements */
.btn-outline-primary {
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Badge Enhancements */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.025em;
}

/* Smooth Text Rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Stats Cards */
.stats-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

/* Nav Tabs Improvements */
.nav-tabs {
    border-bottom: 2px solid var(--bullionet-border);
}

.nav-tabs .nav-link {
    color: var(--bullionet-text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 1rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--bullionet-text-primary);
    border-bottom-color: var(--bullionet-border-light);
}

.nav-tabs .nav-link.active {
    color: var(--bullionet-accent);
    border-bottom-color: var(--bullionet-accent);
    background: transparent;
}

/* Status Badge Colors */
.badge-Active,
.badge-active {
    background: var(--bullionet-success) !important;
    color: white !important;
}

.badge-Pending,
.badge-pending {
    background: var(--bullionet-warning) !important;
    color: white !important;
}

.badge-Suspended,
.badge-suspended {
    background: var(--bullionet-danger) !important;
    color: white !important;
}

.badge-Cancelled,
.badge-cancelled {
    background: var(--bullionet-text-muted) !important;
    color: white !important;
}

.badge-Unpaid,
.badge-unpaid {
    background: var(--bullionet-danger) !important;
    color: white !important;
}

.badge-Paid,
.badge-paid {
    background: var(--bullionet-success) !important;
    color: white !important;
}

.badge-Open,
.badge-open {
    background: var(--bullionet-info) !important;
    color: white !important;
}

.badge-Answered,
.badge-answered {
    background: var(--bullionet-success) !important;
    color: white !important;
}

.badge-Closed,
.badge-closed {
    background: var(--bullionet-text-muted) !important;
    color: white !important;
}

/* Modern Input Focus */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

/* Loading States */
.pageloader-item {
    background: var(--bullionet-bg-primary);
}

.pageloader-layer {
    border-color: var(--bullionet-accent);
}

/* Link Hover Effects */
a:not(.btn):not(.nav-link):not(.dropdown-item) {
    position: relative;
    transition: color 0.2s ease;
}

a:not(.btn):not(.nav-link):not(.dropdown-item):hover {
    color: var(--bullionet-accent-light) !important;
}

/* Section Spacing */
section {
    margin-bottom: 3rem;
}

/* Container Improvements */
.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
}

/* Custom Scrollbar for WebKit */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bullionet-bg-secondary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--bullionet-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bullionet-border-light);
}

/* Responsive Improvements */
@media (max-width: 1200px) {
    /* Large tablets and small desktops */
    .root-boxes .root-box {
        margin-bottom: 1.5rem;
    }

    .root-boxes .root-box .card-body {
        padding: 2rem;
    }
}

@media (max-width: 992px) {
    /* Tablets */
    .root-boxes .root-box {
        margin-bottom: 1.25rem;
    }

    .root-boxes .root-box .card-body {
        padding: 1.5rem;
    }

    .root-boxes .root-box .icon-wrapper {
        width: 70px !important;
        height: 70px !important;
    }

    .root-boxes .root-box .icon-wrapper i {
        font-size: 42px !important;
    }

    .stats-card .card-body {
        padding: 1.25rem;
    }

    .stats-card h2 {
        font-size: 1.75rem;
    }
}

@media (max-width: 768px) {
    /* Mobile devices */
    .root-boxes .root-box {
        margin-bottom: 1rem;
    }

    .root-boxes .root-box .card-body {
        padding: 1.5rem 1rem;
    }

    .root-boxes .root-box .icon-wrapper {
        width: 60px !important;
        height: 60px !important;
        margin-bottom: 1rem !important;
    }

    .root-boxes .root-box .icon-wrapper i {
        font-size: 36px !important;
    }

    .root-boxes .root-box h4 {
        font-size: 1.125rem;
        margin-bottom: 0.75rem !important;
    }

    .root-boxes .root-box p {
        font-size: 0.875rem;
    }

    .root-boxes .root-box .badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    /* Dashboard sections */
    .section-dashboard {
        padding: 1rem !important;
    }

    .section-dashboard .card-body {
        padding: 1rem;
    }

    /* Typography */
    h1, .display-4 {
        font-size: 1.75rem !important;
        margin-bottom: 1rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    .lead {
        font-size: 1rem !important;
    }

    /* Tables */
    .table-responsive {
        border-radius: var(--radius-lg);
        overflow: hidden;
        margin-bottom: 1rem;
    }

    .table thead {
        display: none; /* Hide headers on mobile, use stacked view */
    }

    .table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--bullionet-border);
        border-radius: var(--radius-md);
    }

    .table td {
        display: flex;
        justify-content: space-between;
        padding: 0.75rem;
        border: none !important;
        border-bottom: 1px solid var(--bullionet-border) !important;
    }

    .table td:last-child {
        border-bottom: none !important;
    }

    .table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--bullionet-text-primary);
        margin-right: 1rem;
    }

    /* Stats cards on mobile */
    .stats-card .card-body {
        padding: 1rem;
    }

    .stats-card h2 {
        font-size: 1.5rem;
    }

    .stats-card i {
        font-size: 20px;
    }

    /* Buttons in cards */
    .card .btn {
        width: 100%;
        margin-top: 0.5rem;
    }

    /* Footer columns stack better */
    .footer-content .col-6,
    .footer-content .col-md-2,
    .footer-content .col-md-4 {
        margin-bottom: 1.5rem;
    }

    /* News/Announcements on mobile */
    .root-news .list-group-item {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start !important;
    }

    .root-news .list-group-item i {
        margin-bottom: 0.75rem;
        margin-right: 0 !important;
    }

    .root-news .h3 {
        font-size: 1.125rem;
    }

    /* Breadcrumbs on mobile */
    .breadcrumb {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        flex-wrap: wrap;
    }

    .breadcrumb-item {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 576px) {
    /* Extra small devices */
    .root-boxes .root-box {
        margin-bottom: 0.75rem;
    }

    .root-boxes .root-box .card-body {
        padding: 1.25rem 0.875rem;
    }

    .root-boxes .root-box .icon-wrapper {
        width: 50px !important;
        height: 50px !important;
    }

    .root-boxes .root-box .icon-wrapper i {
        font-size: 28px !important;
    }

    .root-boxes .root-box h4 {
        font-size: 1rem;
    }

    .root-boxes .root-box p {
        font-size: 0.8125rem;
        margin-bottom: 0.5rem;
    }

    /* Stats cards very small */
    .stats-card .card-body {
        padding: 0.75rem;
    }

    .stats-card h2 {
        font-size: 1.25rem;
    }

    .stats-card small {
        font-size: 0.7rem;
    }

    /* Typography extra small */
    h1, .display-4 {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }

    h2 {
        font-size: 1.25rem !important;
    }

    .lead {
        font-size: 0.9375rem !important;
        line-height: 1.5;
    }

    /* Compact spacing */
    .mb-5 {
        margin-bottom: 2rem !important;
    }

    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Footer on very small screens */
    .footer-content .row {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .footer-content h5 {
        font-size: 1.125rem;
    }

    .footer-content h6 {
        font-size: 0.9375rem;
    }

    /* Full width action buttons */
    .d-flex.justify-content-end {
        justify-content: flex-start !important;
        flex-direction: column;
    }

    .d-flex.justify-content-end .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        margin-right: 0 !important;
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.25rem;
    }

    .nav-link {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }

    .form-control,
    .form-select {
        min-height: 44px;
    }

    /* Remove hover effects on touch devices */
    .card:hover {
        transform: none;
    }

    .root-boxes .root-box:hover {
        transform: none;
    }

    /* Add active states instead */
    .card:active {
        transform: scale(0.98);
    }

    .root-boxes .root-box:active {
        transform: scale(0.98);
    }
}

/* Animation Classes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

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

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

/* Card Glow Effect */
.card-glow {
    position: relative;
}

.card-glow::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--bullionet-accent), var(--bullionet-success), var(--bullionet-info));
    border-radius: calc(var(--radius-xl) + 2px);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    filter: blur(10px);
}

.card-glow:hover::after {
    opacity: 0.6;
}

/* Premium Divider */
.premium-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--bullionet-border) 50%, transparent 100%);
    margin: 2rem 0;
}

/* Info Box Improvements */
.info-box {
    background: var(--bullionet-bg-card);
    border: 1px solid var(--bullionet-border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.info-box:hover {
    border-color: var(--bullionet-accent);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

/* Material Icons Sizing */
.material-icons.size-xs { font-size: 16px; }
.material-icons.size-sm { font-size: 20px; }
.material-icons.size-md { font-size: 24px; }
.material-icons.size-lg { font-size: 32px; }
.material-icons.size-xl { font-size: 48px; }

/* Text Utilities */
.text-nowrap { white-space: nowrap; }
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Better Focus Visible */
*:focus-visible {
    outline: 2px solid var(--bullionet-accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Disabled States */
.disabled,
:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Selection Color */
::selection {
    background: var(--bullionet-accent);
    color: white;
}

::-moz-selection {
    background: var(--bullionet-accent);
    color: white;
}
