/* Digital Marketplace - Custom Styles */

/* Root Variables */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --sidebar-width: 280px;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
}

/* Navbar Styles */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
}

.nav-link {
    transition: color 0.2s ease;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

/* Button Styles */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

.btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
    border: none;
}

/* Form Styles */
.form-control {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* Table Styles */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Badge Styles */
.badge {
    font-weight: 500;
    padding: 0.5em 0.8em;
}

/* Alert Styles */
.alert {
    border-radius: 8px;
    border: none;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    min-height: calc(100vh - 56px);
    background: #fff;
    border-right: 1px solid #dee2e6;
}

.sidebar .nav-link {
    color: #333;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin: 2px 8px;
}

.sidebar .nav-link:hover {
    background-color: var(--light-color);
}

.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: #fff;
}

/* Category Card Styles */
.category-card {
    border-left: 4px solid var(--primary-color);
    transition: all 0.2s ease;
}

.category-card:hover {
    border-left-color: var(--success-color);
}

/* Product Card Styles */
.product-card {
    overflow: hidden;
}

.product-card .price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--success-color);
}

.product-card .stock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Topic Styles */
.topic-item {
    border-bottom: 1px solid #eee;
    padding: 1rem;
    transition: background-color 0.2s ease;
}

.topic-item:hover {
    background-color: var(--light-color);
}

.topic-item:last-child {
    border-bottom: none;
}

.topic-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.topic-status.alive {
    background-color: var(--success-color);
}

.topic-status.dead {
    background-color: var(--danger-color);
}

.topic-status.pending {
    background-color: var(--warning-color);
}

/* Message Styles */
.message-bubble {
    position: relative;
}

.message-bubble.own {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
}

.contact-list .list-group-item {
    border: none;
    border-bottom: 1px solid #eee;
}

.contact-list .list-group-item.active {
    background-color: var(--primary-color);
    color: #fff;
}

/* Stats Card Styles */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* User Avatar */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner 0.75s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
}

/* Pagination */
.pagination .page-link {
    border-radius: 6px;
    margin: 0 2px;
    border: none;
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    color: #fff;
}

/* Footer */
footer {
    background: #fff;
    border-top: 1px solid #dee2e6;
}

footer a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--primary-color);
}

/* Utility Classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

.hover-shadow:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Amount Buttons */
.amount-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Copy Button Animation */
.copy-btn {
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        min-height: auto;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body.dark-mode {
        background-color: #1a1a1a;
        color: #f8f9fa;
    }
    
    body.dark-mode .card {
        background-color: #2d2d2d;
        color: #f8f9fa;
    }
    
    body.dark-mode .table {
        color: #f8f9fa;
    }
    
    body.dark-mode .form-control {
        background-color: #3d3d3d;
        border-color: #4d4d4d;
        color: #f8f9fa;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .sidebar,
    .btn,
    footer {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6;
    }
}
