/* shopkey.css - CSS for Key Selling page */

/* ===========================================
   NAVBAR ENHANCED STYLES
   =========================================== */

/* Enhanced Navbar with Gradient */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.navbar.sticky-top {
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

/* Navbar Brand Enhanced */
.navbar-brand {
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-brand i {
    font-size: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.navbar-brand:hover {
    transform: translateY(-2px);
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.3);
}

.navbar-brand:hover i {
    animation: rotate 0.5s ease;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Nav Links Enhanced */
.navbar-nav .nav-link {
    position: relative;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    transition: width 0.3s ease;
}

.navbar-nav .nav-link:hover::before {
    width: 80%;
}

.navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Navbar Text Enhanced */
.navbar-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.navbar-text:hover {
    background: rgba(255, 255, 255, 0.1);
}

.navbar-text i {
    font-size: 1.2rem;
}

/* Navbar Toggler Enhanced */
.navbar-toggler {
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.navbar-toggler:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.3);
}

/* ===========================================
   KEY SPECIFIC STYLES
   =========================================== */

/* Products Container */
.products-container {
    margin-top: 2rem;
}

/* Category Header */
.key-category-header {
    margin: 2rem 0 1.5rem 0;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.key-category-header i {
    font-size: 1.3rem;
}

/* Key Product Section */
.key-product-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.key-product-header-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.key-product-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.key-product-title i {
    color: #667eea;
}

/* Key Type Card */
.key-type-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.key-type-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.key-type-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

.key-type-card:hover::before {
    transform: scaleX(1);
}

.key-type-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.key-type-card.disabled:hover {
    transform: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Key Type Header */
.key-type-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.key-type-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex-shrink: 0;
}

/* Key Type Info */
.key-type-info {
    flex: 1;
    margin-left: 1rem;
}

.key-type-name {
    font-weight: 700;
    color: #2d3748;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.key-type-description {
    color: #718096;
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

/* Key Type Price & Stats */
.key-type-price-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

.key-available-badge {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.key-available-badge i {
    font-size: 0.75rem;
}

.key-price-badge {
    background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(246, 173, 85, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Key Type Actions */
.key-type-actions {
    margin-top: 1rem;
    padding-top: 1rem;
}

.key-btn-buy {
    width: 100%;
    padding: 0.85rem 1.5rem;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.key-btn-buy:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

.key-btn-buy:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    box-shadow: none;
}

.key-btn-login {
    width: 100%;
    padding: 0.85rem 1.5rem;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 12px;
    border: 2px solid #667eea;
    background: transparent;
    color: #667eea;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.key-btn-login:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Empty State */
.key-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #718096;
}

.key-empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.key-empty-state h5 {
    color: #2d3748;
    margin-bottom: 0.5rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay .loading-content {
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .key-type-card {
        padding: 1.25rem;
    }
    
    .key-type-name {
        font-size: 1rem;
    }
    
    .key-type-description {
        font-size: 0.85rem;
    }
    
    .key-price-badge {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
    
    .key-available-badge {
        font-size: 0.8rem;
        padding: 0.35rem 0.7rem;
    }
    
    .key-btn-buy,
    .key-btn-login {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* Fade animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================================
   HEADER BALANCE STYLES
   =========================================== */

.header-balance-wrapper {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 8px 14px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-balance-wrapper:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#header-balance {
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

#header-balance i {
    font-size: 1rem;
    margin-right: 6px;
}

.balance-text {
    font-weight: 600;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

#btn-deposit-header {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    border: none;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
    transition: all 0.3s ease;
}

#btn-deposit-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

#btn-deposit-header:active {
    transform: translateY(0);
}

#btn-deposit-header i {
    margin-right: 4px;
}

/* ===========================================
   RESPONSIVE HEADER STYLES
   =========================================== */

/* Desktop/Mobile Section Visibility */
.desktop-user-section {
    display: flex;
}

.balance-section-mobile,
.deposit-user-section-mobile,
.user-menu-items-mobile {
    display: none;
}

/* Mobile Styles */
@media (max-width: 991.98px) {
    .desktop-user-section {
        display: none !important;
    }
    
    .balance-section-mobile,
    .deposit-user-section-mobile,
    .user-menu-items-mobile {
        display: block;
    }
    
    /* Mobile Balance Wrapper */
    .header-balance-wrapper-mobile {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        padding: 12px;
        backdrop-filter: blur(10px);
        margin: 8px 0;
        text-align: center;
    }
    
    .header-balance-wrapper-mobile:hover {
        background: rgba(255, 255, 255, 0.15);
    }
    
    #header-balance-mobile {
        font-size: 1rem !important;
        font-weight: 600 !important;
    }
    
    /* Mobile Deposit Button */
    .deposit-btn-header-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
        transition: all 0.3s ease;
    }
    
    .deposit-btn-header-mobile:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
    }
    
    /* Mobile User Avatar */
    .user-avatar-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .user-avatar-mobile .user-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid rgba(255, 255, 255, 0.5);
    }
    
    /* Mobile User Menu */
    .user-menu-list-mobile {
        padding: 16px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        margin: 8px 0;
    }
    
    .user-info-mobile {
        text-align: center;
    }
    
    .user-name-mobile {
        font-size: 1.1rem;
    }
    
    .user-email-mobile {
        font-size: 0.875rem;
    }
    
    .user-menu-item-mobile {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 12px 16px;
        color: white;
        text-decoration: none;
        border-radius: 6px;
        transition: all 0.2s ease;
        margin: 4px 0;
    }
    
    .user-menu-item-mobile:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }
    
    .user-menu-item-mobile i {
        width: 20px;
        text-align: center;
        font-size: 1.1rem;
    }
    
    /* Mobile Navbar Collapse */
    .navbar-collapse {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Mobile Navbar Brand */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    /* Mobile Nav Links */
    .navbar-nav {
        gap: 8px;
    }
    
    .nav-item {
        margin: 4px 0;
    }
    
    .nav-link {
        padding: 10px 16px !important;
        border-radius: 6px;
    }
}

/* Extra Small Devices */
@media (max-width: 575.98px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .deposit-btn-header-mobile {
        font-size: 0.875rem;
        padding: 0.625rem 0.75rem;
    }
    
    .deposit-btn-header-mobile .deposit-text {
        font-size: 0.875rem;
    }
    
    #header-balance-mobile {
        font-size: 0.9rem !important;
    }
    
    .balance-text {
        font-size: 0.9rem;
    }
}

/* Navbar Toggler Icon */
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ===========================================
   KEYS MANAGEMENT SECTION
   =========================================== */

.keys-management-card {
    border-radius: 12px;
    overflow: hidden;
}

.keys-management-card .card-body {
    overflow: hidden;
}

.tab-content {
    overflow: hidden;
}

.keys-management-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    padding: 1.25rem 1.5rem;
    border: none;
}

.keys-management-header h5 {
    font-weight: 600;
    font-size: 1.1rem;
}

.nav-tabs-custom {
    border-bottom: 2px solid #e9ecef;
    padding: 0 1.5rem;
    margin: 0;
    background: #f8f9fa;
}

.nav-tabs-custom .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #6c757d;
    padding: 1rem 1.25rem;
    font-weight: 500;
    transition: all 0.3s ease;
    background: transparent;
}

.nav-tabs-custom .nav-link:hover {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.nav-tabs-custom .nav-link.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
    font-weight: 600;
}

.keys-table {
    font-size: 0.95rem;
}

/* Table responsive wrapper - prevent overflow on hover */
.tab-content .table-responsive {
    overflow-x: auto;
    overflow-y: hidden;
}

.keys-table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    color: #495057;
    padding: 1rem;
    white-space: nowrap;
}

.keys-table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.key-row {
    transition: all 0.2s ease;
    position: relative;
}

.key-row:hover {
    background-color: #f8f9fa !important;
    transform: translateX(2px);
}

.key-row.table-secondary {
    opacity: 0.7;
}

.key-in-row {
    background: #f8f9fa;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #e83e8c;
    font-weight: 500;
    word-break: break-all;
    border: 1px solid #e9ecef;
    max-width: 300px;
    display: inline-block;
}

.btn-copy-key {
    flex-shrink: 0;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    overflow: hidden;
}

.btn-copy-key:hover {
    transform: scale(1.05);
}


.keys-table .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .keys-management-header {
        padding: 1rem;
    }
    
    .keys-management-header h5 {
        font-size: 1rem;
    }
    
    .nav-tabs-custom {
        padding: 0;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-tabs-custom .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    .keys-table {
        font-size: 0.85rem;
    }
    
    .keys-table thead th {
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .keys-table tbody td {
        padding: 0.75rem 0.5rem;
    }
    
    .key-in-row {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
        max-width: 150px;
    }
    
    .keys-table thead th:nth-child(4),
    .keys-table tbody td:nth-child(4) {
        min-width: 120px;
    }
}

@media (max-width: 576px) {
    .keys-management-card {
        border-radius: 8px;
    }
    
    .keys-table thead {
        display: none;
    }
    
    .keys-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 1rem;
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .keys-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 0;
        border: none;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .keys-table tbody td:last-child {
        border-bottom: none;
    }
    
    .keys-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #495057;
        text-align: left;
        margin-right: 1rem;
        flex-shrink: 0;
    }
    
    .keys-table tbody td:first-child {
        font-weight: 600;
        font-size: 1.1rem;
        padding-bottom: 0.75rem;
        border-bottom: 2px solid #e9ecef;
        margin-bottom: 0.5rem;
    }
    
    .keys-table tbody td:first-child::before {
        display: none;
    }
    
    .key-in-row {
        max-width: 100%;
        word-break: break-all;
        flex: 1;
    }
    
    .btn-copy-key {
        flex-shrink: 0;
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
}

