/* Basic Dashboard Styles */
:root {
    --primary-color: #4361ee;
    --secondary-color: #7209b7;
    --success-color: #4ade80;
    --danger-color: #f87171;
    --warning-color: #fbbf24;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar.active {
    transform: translateX(0);
}

@media (min-width: 768px) {
    .sidebar {
        transform: translateX(0);
        position: relative;
    }
    
    .sidebar-toggle {
        display: none;
    }
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background: var(--background);
    color: var(--primary-color);
}

.nav-item.active {
    background: var(--background);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

.nav-item i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 0;
    width: 100%;
}

@media (min-width: 768px) {
    .main-content {
        margin-left: 250px;
        width: calc(100% - 250px);
    }
}

/* Top Bar */
.top-bar {
    background: var(--card-bg);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-primary);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Dashboard Content */
.dashboard-content {
    padding: 2rem;
}

.welcome-section {
    margin-bottom: 2rem;
}

.welcome-section h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.xiaomi-card {
    border-top: 4px solid var(--primary-color);
}

.samsung-card {
    border-top: 4px solid var(--secondary-color);
}

.balance-card {
    border-top: 4px solid var(--success-color);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.stat-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stat-change {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--text-secondary);
    opacity: 0.2;
}

.stat-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--secondary-color);
}

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

.btn-icon {
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.btn-icon:hover {
    color: var(--primary-color);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.875rem;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Profile Section */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    position: relative;
}

.profile-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.status-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid white;
}

.status-badge.active {
    background: var(--success-color);
}

.info-grid {
    display: grid;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--background);
    border-radius: 0.375rem;
}

.info-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.info-value {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--background);
    border-radius: 0.375rem;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-icon.success {
    background: rgba(74, 222, 128, 0.1);
    color: var(--success-color);
}

.activity-icon.danger {
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger-color);
}

.activity-details {
    flex: 1;
}

.activity-title {
    font-weight: 500;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.activity-amount {
    font-weight: 600;
}

.activity-amount.positive {
    color: var(--success-color);
}

.activity-amount.negative {
    color: var(--danger-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: var(--card-bg);
    margin: 5% auto;
    padding: 0;
    border-radius: 0.5rem;
    width: 90%;
    max-width: 500px;
}

.modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.25rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

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

.form-control {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-primary {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

.badge-success {
    background: rgba(74, 222, 128, 0.1);
    color: var(--success-color);
}

.badge-danger {
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger-color);
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.status-badge.status-pending {
    background: rgba(251, 191, 36, 0.1);
    color: var(--warning-color);
}

.status-badge.status-accepted,
.status-badge.status-active {
    background: rgba(74, 222, 128, 0.1);
    color: var(--success-color);
}

.status-badge.status-rejected,
.status-badge.status-expired {
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger-color);
}

.status-badge.status-used {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

/* Utility classes */
.text-muted {
    color: var(--text-secondary);
}

.text-primary {
    color: var(--primary-color);
}

.mt-4 {
    margin-top: 2rem;
}

/* File upload */
.file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-label {
    display: block;
    padding: 1rem;
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-label:hover {
    border-color: var(--primary-color);
    background: rgba(67, 97, 238, 0.05);
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Input group */
.input-group {
    display: flex;
    align-items: center;
}

.input-addon {
    padding: 0.5rem 1rem;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 0.375rem 0 0 0.375rem;
}

.input-group .form-control {
    border-radius: 0 0.375rem 0.375rem 0;
}

/* Action button */
.action-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--background);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Refund button */
.refund-btn {
    width: 100%;
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Loading */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* OTP Specific Styles */
.otp-section .card {
    margin-bottom: 1.5rem;
}

.credits-display {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 600;
}

.info-box {
    background: rgba(67, 97, 238, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    border-radius: 0.5rem;
    display: flex;
    gap: 1rem;
    align-items: start;
    margin-bottom: 2rem;
}

.info-box i {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-top: 0.25rem;
}

.otp-generator {
    max-width: 500px;
    margin: 0 auto;
}

.btn-large {
    width: 100%;
    padding: 1rem;
    font-size: 1.125rem;
}

.otp-display {
    margin-top: 2rem;
    animation: fadeIn 0.5s ease;
}

.otp-success {
    text-align: center;
    padding: 2rem;
    background: rgba(74, 222, 128, 0.1);
    border-radius: 1rem;
}

.otp-success i {
    font-size: 3rem;
    color: var(--success-color);
    margin-bottom: 1rem;
}

.otp-code-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 0.5rem;
    border: 2px dashed var(--success-color);
}

.otp-code {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    letter-spacing: 0.1em;
}

.otp-small {
    font-family: 'Courier New', monospace;
    background: var(--background);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.otp-validity {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.instructions {
    display: grid;
    gap: 1.5rem;
}

.instruction-step {
    display: flex;
    gap: 1.5rem;
    align-items: start;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.step-content p {
    color: var(--text-secondary);
    margin: 0;
}