/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a1a;
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

/* Links */
a {
    color: #ff6b35;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #e55a30;
}

/* Buttons */
.add-funds-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 10px;
}

.add-funds-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1ba085 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.add-funds-btn i {
    font-size: 16px;
}

.add-funds-btn.active {
    background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
    box-shadow: 0 4px 15px rgba(32, 201, 151, 0.3);
}

.btn {
    background: #ff6b35;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    min-width: 120px;
}

.btn:hover {
    background: #e55a30;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #444;
    color: #e0e0e0;
}

.btn-secondary:hover {
    background: #555;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-success {
    background: #4CAF50;
}

.btn-success:hover {
    background: #45a049;
}

.btn-danger {
    background: #f44336;
}

.btn-danger:hover {
    background: #da190b;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #e0e0e0;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group input {
    width: 100%;
    padding: 0.75rem;
    padding-left: 2.5rem;
    border: 2px solid #444;
    border-radius: 8px;
    background: #2c2c2c;
    color: #e0e0e0;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.input-group input::placeholder {
    color: #888;
}

.input-group i {
    position: absolute;
    left: 0.75rem;
    color: #888;
    font-size: 1rem;
    z-index: 1;
}

.input-group .toggle-password {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.input-group .toggle-password:hover {
    color: #ff6b35;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    color: #888;
    font-size: 0.85rem;
}

/* Messages */
.message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
    font-weight: 500;
    border-left: 4px solid;
}

.message.success {
    background: rgba(76, 175, 80, 0.1);
    border-left-color: #4CAF50;
    color: #4CAF50;
}

.message.error {
    background: rgba(244, 67, 54, 0.1);
    border-left-color: #f44336;
    color: #f44336;
}

.message.warning {
    background: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
    color: #ffc107;
}

.message.info {
    background: rgba(33, 150, 243, 0.1);
    border-left-color: #2196F3;
    color: #2196F3;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #666;
    border-top: 2px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }

.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .input-group input {
        padding: 0.625rem;
        padding-left: 2.25rem;
        font-size: 0.9rem;
    }
    
    .input-group i {
        left: 0.625rem;
    }
    
    .input-group .toggle-password {
        right: 0.625rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .input-group input {
        padding: 0.5rem;
        padding-left: 2rem;
        font-size: 0.85rem;
    }
    
    .input-group i {
        left: 0.5rem;
        font-size: 0.9rem;
    }
    
    .input-group .toggle-password {
        right: 0.5rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #2c2c2c;
}

::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Focus Styles for Accessibility */
.btn:focus,
input:focus,
button:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .input-group input {
        border-width: 3px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Header */
.header {
    background: linear-gradient(135deg, #2c2c2c 0%, #3a3a3a 100%);
    padding: 1rem 0;
    border-bottom: 2px solid #444;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo i {
    color: #ffd700;
    margin-right: 0.5rem;
    font-size: 1.8rem;
}

.logo span {
    color: #ff6b35;
    font-size: 1.8rem;
    font-weight: bold;
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav .nav-link {
    display: flex;
    align-items: center;
    color: #e0e0e0;
    text-decoration: none;
    padding: 0.8rem 1rem;
    transition: all 0.3s ease;
    border-radius: 8px;
    gap: 0.5rem;
}

.nav .nav-link:hover {
    background: #444;
    color: #ff6b35;
    transform: translateY(-2px);
}

.nav .nav-link.active {
    background: #ff6b35;
    color: white;
}

.nav .nav-link i {
    font-size: 1.1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.balance {
    background: #ff6b35;
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 2px 10px rgba(255, 107, 53, 0.3);
    margin-right: 15px;
}

.user-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.user-btn, .logout-btn, .login-btn, .register-btn {
    background: #444;
    color: #e0e0e0;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: none; /* Hide by default, show via JavaScript */
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* When shown, use inline-flex for proper alignment */
.user-btn.show, .logout-btn.show, .login-btn.show, .register-btn.show {
    display: inline-flex;
}

.user-btn:hover, .logout-btn:hover, .login-btn:hover, .register-btn:hover {
    background: #555;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.login-btn {
    background: linear-gradient(135deg, #ff6b35, #e55a30);
    color: white;
}

.login-btn:hover {
    background: linear-gradient(135deg, #e55a30, #cc4825);
}

.register-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.register-btn:hover {
    background: linear-gradient(135deg, #45a049, #3e8e41);
}

/* Main Container */
.container {
    background: #1a1a1a;
    min-height: 100vh;
    padding-top: 80px;
}

.main-container {
    display: flex;
    min-height: calc(100vh - 80px);
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #2c2c2c;
    padding: 1rem 0;
    border-right: 2px solid #444;
    overflow-y: auto;
    position: fixed;
    height: calc(100vh - 80px);
}

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

.sidebar-header h2 {
    color: #ff6b35;
    font-size: 1.3rem;
}

.sidebar-nav ul {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    color: #e0e0e0;
    text-decoration: none;
    padding: 0.8rem 1rem;
    transition: all 0.3s ease;
    border-radius: 5px;
    margin: 0 0.5rem;
}

.sidebar .nav-link:hover {
    background: #444;
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background: #ff6b35;
    color: white;
}

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

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
    background: #1a1a1a;
    max-width: calc(100% - 250px);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.content-header h2 {
    color: #ff6b35;
    font-size: 2rem;
}

.search-container {
    width: 300px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.empty-state i {
    font-size: 3em;
    margin-bottom: 20px;
    color: #444;
}

.empty-state h3 {
    margin: 0 0 10px 0;
    color: #e0e0e0;
}

.empty-state p {
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* Login Prompt Modal */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #2c2c2c;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #444;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #444;
}

.modal-header h2 {
    color: #e0e0e0;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background-color: #444;
    color: #e0e0e0;
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    color: #b0b0b0;
    margin-bottom: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #444;
}

.btn-tertiary {
    background-color: transparent;
    color: #888;
    border: 1px solid #444;
}

.btn-tertiary:hover {
    background-color: #444;
    color: #e0e0e0;
    border-color: #555;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}
