/* General Styles */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

body {
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Make footer stick to bottom */
footer {
    margin-top: auto;
}

footer a {
    text-decoration: none;
    transition: opacity 0.2s;
}

footer a:hover {
    opacity: 0.8;
}

/* Card styles */
.lottery-card {
    transition: transform 0.2s;
    margin-bottom: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.lottery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Custom badges */
.badge-prize {
    background-color: var(--warning-color);
    color: #000;
}

.badge {
    font-weight: 500;
    padding: 0.5em 0.8em;
}

/* Dashboard widgets */
.dashboard-widget {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.dashboard-widget h3 {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* Charts */
.chart-container {
    position: relative;
    margin: auto;
    height: 300px;
    width: 100%;
}

/* Wallet section */
.wallet-balance {
    font-size: 2rem;
    font-weight: bold;
    color: var(--success-color);
}

.wallet-address {
    word-break: break-all;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    font-family: monospace;
    cursor: pointer;
    transition: background-color 0.2s;
}

.wallet-address:hover {
    background-color: #e9ecef;
}

/* QR Code container */
.qr-container {
    display: flex;
    justify-content: center;
    padding: 10px;
    background-color: white;
    border-radius: 4px;
}

.qr-container img {
    max-width: 200px;
}

.qr-code-container {
    background: white;
    padding: 1rem;
    display: inline-block;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Lottery Ticket Styles */
.lottery-ticket {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.lottery-ticket:before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: linear-gradient(135deg, #007bff, #6610f2);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.3;
}

.ticket-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: #495057;
    margin-bottom: 5px;
    font-family: monospace;
}

/* Friends list */
.friend-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    margin-bottom: 1rem;
    background: white;
}

.friend-item .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 1rem;
}

.friend-suggestion {
    cursor: pointer;
    transition: background-color 0.2s;
}

.friend-suggestion:hover {
    background-color: #f8f9fa;
}

/* Support chat */
.chat-container {
    height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.chat-message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 10px;
    max-width: 80%;
}

.chat-message.user {
    background-color: var(--primary-color);
    color: white;
    margin-left: auto;
}

.chat-message.admin {
    background-color: #e9ecef;
    margin-right: auto;
}

.message-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.message {
    margin-bottom: 20px;
    max-width: 80%;
}

.message.user-message {
    margin-left: auto;
}

.message-content {
    padding: 12px 15px;
    border-radius: 15px;
    position: relative;
}

.user-message .message-content {
    background-color: #007bff;
    color: white;
    border-bottom-right-radius: 5px;
}

.admin-message .message-content {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom-left-radius: 5px;
}

/* Responsive tables */
@media (max-width: 768px) {
    .table-responsive-stack td {
        display: block;
        width: 100%;
        text-align: right;
        padding-left: 50%;
        position: relative;
    }

    .table-responsive-stack td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 50%;
        padding-left: 15px;
        text-align: left;
        font-weight: bold;
    }

    .card-body {
        padding: 1rem;
    }

    .message {
        max-width: 90%;
    }

    .ticket-number {
        font-size: 1rem;
    }
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Form styles */
.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Custom File Input */
.custom-file-input::-webkit-file-upload-button {
    visibility: hidden;
}

.custom-file-input::before {
    content: 'Select File';
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    cursor: pointer;
}

/* Custom button styles */
.btn-lottery {
    background-color: var(--primary-color);
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    color: white;
    transition: all 0.3s ease;
}

.btn-lottery:hover {
    background-color: #0b5ed7;
    transform: translateY(-2px);
}

/* Notification badge */
.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
    background-color: var(--danger-color);
}

/* Progress bars */
.progress {
    height: 10px;
    border-radius: 5px;
}

.progress-bar {
    transition: width 1s ease-in-out;
    background-image: linear-gradient(45deg, 
        rgba(255,255,255,.15) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255,255,255,.15) 50%, 
        rgba(255,255,255,.15) 75%, 
        transparent 75%, 
        transparent
    );
    background-size: 1rem 1rem;
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    from { background-position: 1rem 0; }
    to { background-position: 0 0; }
}

/* Custom alert styles */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    box-shadow: 0 2px 4px rgba(21,87,36,0.1);
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    box-shadow: 0 2px 4px rgba(114,28,36,0.1);
}

/* Modal customization */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* Tooltip customization */
.tooltip {
    font-size: 0.875rem;
}

/* Custom switch */
.form-switch .form-check-input {
    width: 3em;
}

/* Stats cards */
.stats-card {
    background: linear-gradient(45deg, var(--primary-color), #0b5ed7);
    color: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.stats-card h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.stats-card .value {
    font-size: 2rem;
    font-weight: bold;
}

/* Timeline */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background-color: var(--primary-color);
}

.timeline-item {
    margin-bottom: 20px;
    position: relative;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Loading Animation */
@keyframes spinner {
    to { transform: rotate(360deg); }
}

.loading {
    position: relative;
}

.loading:before {
    content: '';
    box-sizing: border-box;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border-radius: 50%;
    border: 2px solid #ccc;
    border-top-color: #007bff;
    animation: spinner .6s linear infinite;
}

/* Table Enhancements */
.table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: rgba(0,123,255,0.05);
}

/* Tab Navigation Enhancement */
.nav-tabs .nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #007bff;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-tabs .nav-link:hover:before,
.nav-tabs .nav-link.active:before {
    width: 100%;
}

/* Dashboard Stats Cards */
.stat-card {
    border: none;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.stat-card .icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Button Hover Effects */
.btn {
    position: relative;
    overflow: hidden;
    transform: translate3d(0, 0, 0);
}

.btn:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover:after {
    width: 200%;
    height: 200%;
}