/* Main Styles for My Success Application */

/* Global Menu Button - Always visible on all devices */
#toggle-sidebar, .toggle-sidebar {
    display: flex !important;
    position: fixed !important;
    top: 15px !important;
    left: 15px !important;
    z-index: 99999 !important;
    background-color: var(--primary-color, #1a2c4e) !important;
    color: white !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 4px !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    border: none !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2) !important;
    opacity: 1 !important;
    visibility: visible !important;
}
:root {
    --primary-color: #1a2c4e;
    --secondary-color: #ffc107;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-color: #6c757d;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    margin: 0;
    padding: 0;
}

/* Header Styles */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.logo img {
    height: 40px;
    margin-right: 10px;
}

/* Dashboard Styles */
.dashboard {
    padding: 20px;
}

.dashboard-header {
    margin-bottom: 30px;
    text-align: center;
    padding: 15px 0;
}

.dashboard-header .company-logo {
    margin-bottom: 15px;
}

.dashboard-header .company-logo img {
    max-height: 80px;
    margin: 0 auto;
}

.dashboard-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dashboard-subtitle {
    font-size: 18px;
    color: var(--gray-color);
    font-weight: 500;
}

/* Responsive styles for mobile devices */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 10px 0;
    }
    
    .dashboard-header .company-logo img {
        max-height: 60px;
    }
    
    .dashboard-title {
        font-size: 24px;
    }
    
    .dashboard-subtitle {
        font-size: 16px;
    }
}

.stats-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-card-title {
    font-size: 16px;
    color: var(--gray-color);
    margin-bottom: 10px;
}

.stats-card-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.stats-card-icon {
    font-size: 40px;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

/* Sidebar Styles */
.sidebar {
    background-color: var(--primary-color);
    color: white;
    height: 100%;
    width: 250px; /* Desktop width */
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    overflow-y: auto; /* Enable vertical scrolling */
    transition: 0.3s; /* Transition effect */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.sidebar-header {
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.1);
}

.sidebar-menu {
    padding: 0;
    list-style: none;
}

.sidebar-menu li {
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu li a {
    color: white;
    text-decoration: none;
    display: block;
    transition: all 0.3s;
}

.sidebar-menu li a:hover {
    padding-left: 10px;
    color: var(--secondary-color);
}

.sidebar-menu li.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-menu li.active a {
    color: var(--secondary-color);
}

.content-wrapper {
    margin-left: 250px;
    padding: 20px;
    transition: all 0.3s;
}

/* Auth Styles */
.auth-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo img {
    height: 80px;
}

.auth-title {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    font-weight: bold;
    color: var(--dark-color);
}

.auth-form .form-control {
    height: 45px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.auth-form .btn-primary {
    background-color: var(--primary-color);
    border: none;
    height: 45px;
    border-radius: 4px;
    font-weight: bold;
    width: 100%;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.data-table th, .data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

.data-table tr:hover {
    background-color: #f5f5f5;
}

.data-table .btn {
    padding: 5px 10px;
    margin-right: 5px;
}

/* Referral Member Card Styles - Dark Professional Theme */
.referral-member-card {
    background-color: #1e2a38; /* Dark blue-gray background */
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid #4e73df; /* Accent color */
    height: 100%;
    color: #ffffff;
}

.referral-member-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    background-color: #263545; /* Slightly lighter on hover */
}

.referral-member-card .stats-card-icon {
    font-size: 40px;
    color: #4e73df; /* Bright accent color */
    margin-bottom: 10px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.referral-member-card .stats-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: 0.5px;
}

.member-details {
    margin-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.member-detail-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.member-detail-item i {
    width: 20px;
    margin-right: 10px;
    color: #ffc107; /* Gold accent for icons */
}

.member-detail-item span {
    flex: 1;
    word-break: break-word;
}

/* Highlight important information */
.member-detail-item:nth-child(3) i, /* MS Coins icon */
.member-detail-item:nth-child(3) span {
    color: #36b9cc; /* Highlight coin values with cyan */
    font-weight: 600;
}

/* Light theme support (inverted) */
[data-theme="light"] .referral-member-card {
    background-color: #1e2a38; /* Keep dark even in light theme */
    color: white;
}

[data-theme="light"] .referral-member-card .stats-card-title {
    color: white;
}

.info-item {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    align-items: baseline;
}

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

.info-name {
    font-weight: 500;
    min-width: 90px;
    font-size: 14px;
    opacity: 0.9;
}

.info-data {
    font-size: 14px;
    font-weight: 600;
    word-break: break-word; /* Ensure long emails wrap properly */
    flex: 1;
}

/* Desktop Table Styles */
@media (min-width: 768px) {
    .data-table th, .data-table td {
        padding: 12px 15px;
        white-space: normal;
    }
}

/* Button Styles */
.btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: #0f1d36;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    border: none;
}

.btn-secondary:hover {
    background-color: #e0a800;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
    border: none;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    border: none;
}

/* Alert Styles */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Card Styles */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    color: var(--primary-color);
}

.card-body {
    padding: 20px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 44, 78, 0.25);
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Responsive Styles */
@media (max-width: 768px) {
    /* Hide sidebar by default on mobile */
    .sidebar {
        width: 0;
        overflow: hidden;
        left: -250px;
    }
    
    .content-wrapper {
        margin-left: 0;
        width: 100%;
    }
    
    /* Show sidebar when active */
    .sidebar.active {
        width: 250px;
        left: 0;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    }
    
    /* Always show toggle button on mobile */
    .toggle-sidebar {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Add overlay when sidebar is active */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .toggle-sidebar {
        left: 20px;
        z-index: 1001;
        cursor: pointer;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        transition: all 0.3s ease;
        outline: none;
        font-size: 18px;
    }
    
    .toggle-sidebar.active {
        left: 260px;
    }
    
    /* Make cards full width on mobile */
    .col-md-6, .col-md-4, .col-md-3 {
        width: 100%;
        padding: 0 10px;
    }
    
    /* Adjust form elements for mobile */
    input, select, textarea {
        width: 100%;
        max-width: 100%;
    }
    
    /* Adjust table display for mobile */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Improve spacing on mobile */
    .card {
        margin-bottom: 15px;
    }
    
    /* Fix for sidebar overlay */
    body.sidebar-active {
        overflow: hidden;
    }
    
    /* Add overlay when sidebar is active */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        transition: 0.3s;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

/* Utility Classes */
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-bold { font-weight: bold; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.p-10 { padding: 10px; }
.p-20 { padding: 20px; }

/* Captcha Styles */
.captcha-container {
    margin-bottom: 20px;
}

.captcha-image {
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 5px;
    color: var(--primary-color);
    user-select: none;
}

.refresh-captcha {
    margin-left: 10px;
    cursor: pointer;
    color: var(--primary-color);
}

/* QR Code Styles */
.qr-code-container {
    text-align: center;
    margin: 20px 0;
}

.qr-code-image {
    max-width: 200px;
    border: 1px solid #ddd;
    padding: 10px;
    background-color: white;
}

.wallet-address {
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 4px;
    margin: 20px 0;
    word-break: break-all;
    position: relative;
}

.copy-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Toggle Sidebar Button */
.toggle-sidebar {
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    display: none;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    outline: none;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .toggle-sidebar {
        display: block;
    }
}
