/* Custom Styles for AIToolsMarket */

/* Global Responsive Improvements */
@media (max-width: 768px) {
    .display-4, .display-5, .display-6 {
        font-size: 2rem !important;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}

/* Card Hover Effects */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card {
    background-color: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.4) !important;
}

.hover-shadow:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.4) !important;
}

/* Form Improvements (Dark) */
.form-control,
.form-select {
    background-color: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.35);
    background-color: #1e293b;
    color: #f1f5f9;
}

.input-group-text {
    background-color: #334155;
    border-color: #334155;
    color: #94a3b8;
}

/* Table Responsive Improvements */
@media (max-width: 767.98px) {
    .table-responsive {
        border: 0;
    }
    
    .table thead {
        display: none;
    }
}

/* Badge Improvements */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
}

/* Button Improvements */
.btn {
    transition: all 0.2s ease-in-out;
}

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

/* Alert Improvements (Dark) */
.alert {
    border-left: 4px solid;
}

.alert-success {
    border-left-color: #22c55e;
    background-color: rgba(34, 197, 94, 0.15);
    color: #86efac;
}

.alert-danger {
    border-left-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.alert-warning {
    border-left-color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

.alert-info {
    border-left-color: #06b6d4;
    background-color: rgba(6, 182, 212, 0.15);
    color: #67e8f9;
}

/* Navigation Improvements */
.navbar-brand {
    font-size: 1.5rem;
}

.navbar-logo {
    height: 58px;
    width: auto;
    max-width: 220px;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    object-fit: contain;
}

.navbar-brand:hover .navbar-logo {
    transform: scale(1.08);
    opacity: 0.95;
}

@media (max-width: 991.98px) {
    .navbar-logo {
        height: 52px;
        max-width: 200px;
    }
}

@media (max-width: 767.98px) {
    .navbar-logo {
        height: 46px;
        max-width: 180px;
    }
}

@media (max-width: 575.98px) {
    .navbar-logo {
        height: 42px;
        max-width: 160px;
    }
}

.footer-logo {
    height: 78px;
    width: auto;
    max-width: 240px;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    object-fit: contain;
}

.footer-brand a:hover .footer-logo,
a:hover .footer-logo {
    transform: scale(1.08);
    opacity: 0.95;
}

@media (max-width: 991.98px) {
    .footer-logo {
        height: 70px;
        max-width: 220px;
    }
}

@media (max-width: 767.98px) {
    .footer-logo {
        height: 62px;
        max-width: 200px;
    }
}

@media (max-width: 575.98px) {
    .footer-logo {
        height: 54px;
        max-width: 180px;
    }
}

@media (max-width: 991.98px) {
    .navbar-nav {
        margin-top: 1rem;
    }
}

/* Sticky Top Fix for Mobile */
@media (max-width: 991.98px) {
    .sticky-top {
        position: relative !important;
    }
}

/* Image Responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Loading States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Focus States (Dark) */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.35);
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    footer {
        display: none !important;
    }
}

/* User Panel Sidebar Styles (Dark) */
.sidebar {
    min-height: calc(100vh - 56px);
    background-color: #1e293b;
    border-right: 1px solid #334155;
    padding-top: 1rem;
}

.sidebar-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid #334155;
}

/* Sidebar Profile Section (Dark) */
.sidebar-header .bg-white {
    transition: all 0.2s ease-in-out;
    background-color: #334155 !important;
    border: 1px solid #475569;
}

.sidebar-header .bg-white:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.sidebar-header .dropdown-toggle {
    border: none;
    background: transparent;
    padding: 0.25rem 0.5rem;
    color: #f1f5f9;
}

.sidebar-header .dropdown-toggle:hover {
    background-color: #475569;
    border-radius: 0.25rem;
}

.sidebar-header .dropdown-menu {
    min-width: 180px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.4);
    border: 1px solid #334155;
    background-color: #1e293b;
}

.sidebar-header .dropdown-item {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #f1f5f9;
}

.sidebar-header .dropdown-item:hover {
    background-color: #334155;
}

.sidebar-header .dropdown-item.text-danger:hover {
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171 !important;
}

.sidebar-header .text-truncate {
    max-width: 120px;
}

.sidebar .nav-link {
    color: #94a3b8;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar .nav-link:hover {
    background-color: #334155;
    color: #818cf8;
}

.sidebar .nav-link.active {
    background-color: #6366f1;
    color: #fff;
    font-weight: 500;
}

.sidebar .nav-link.active:hover {
    background-color: #4f46e5;
    color: #fff;
}

.sidebar .btn-link {
    text-decoration: none;
    color: #f87171;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
}

.sidebar .btn-link:hover {
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Sidebar Responsive */
@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        top: 56px;
        left: -100%;
        width: 280px;
        height: calc(100vh - 56px);
        transition: left 0.3s ease-in-out;
        z-index: 1000;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .sidebar.collapse:not(.show) {
        display: block !important;
        left: -100%;
    }
    
    /* Add overlay when sidebar is open on mobile */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 56px;
        left: 0;
        width: 100%;
        height: calc(100vh - 56px);
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        transition: opacity 0.3s ease-in-out;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* Mobile sidebar profile section */
    .sidebar-header .bg-white {
        padding: 0.75rem;
    }
    
    .sidebar-header .text-truncate {
        max-width: 150px;
    }
    
    /* Ensure dropdown works on mobile */
    .sidebar-header .dropdown-menu {
        position: absolute !important;
        z-index: 1001;
    }
}

/* Main Content Area Adjustments */
main {
    min-height: calc(100vh - 56px);
}

/* Page Header Improvements (Dark) */
.border-bottom {
    border-color: #334155 !important;
}

/* Sidebar Toggle Button for Mobile (Dark) */
@media (max-width: 767.98px) {
    .sidebar-toggle {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1001;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background-color: #6366f1;
        color: #fff;
        border: none;
        box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
    }
}

/* Payment Screenshot Modal Styles */
.screenshot-container {
    position: relative;
    overflow: hidden;
}

.screenshot-container img {
    transition: opacity 0.2s ease-in-out;
    will-change: opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.modal.show .screenshot-container img {
    opacity: 1 !important;
}

/* Prevent image flickering in modals */
.modal[id^="screenshotModal"] .modal-body img {
    display: block;
    opacity: 1;
    visibility: visible;
}

.modal[id^="screenshotModal"].show .modal-body img {
    opacity: 1 !important;
    visibility: visible !important;
}
