/* SNSP Payment API - Merchant Dashboard Styles */

:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --secondary: #6366f1;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #475569;
    --success: #22c55e;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

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

.user-info {
    color: var(--primary);
    font-weight: 500;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card h2 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

/* Intro Card */
.intro-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(99, 102, 241, 0.1));
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.intro-card h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.features {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: center;
    gap: 8px;
}

.feature-icon {
    font-size: 20px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--bg-input);
}

.btn-warning {
    background: var(--warning);
    color: black;
}

.btn-warning:hover {
    background: #d97706;
}

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

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-full {
    width: 100%;
}

.btn-copy {
    background: var(--bg-input);
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-copy:hover {
    background: var(--border);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-muted);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    transition: border-color 0.2s;
}

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

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Shops List */
.shops-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.shop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-input);
    border-radius: 10px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.shop-item:hover {
    border-color: var(--primary);
    transform: translateX(5px);
}

.shop-info h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.shop-info span {
    font-size: 13px;
    color: var(--text-muted);
}

.shop-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.shop-status.active {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.shop-status.inactive {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--bg-input);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* Settings Section */
.settings-section,
.danger-section,
.payments-section,
.test-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border);
}

.danger-section {
    background: rgba(239, 68, 68, 0.1);
    margin: 25px -25px -25px;
    padding: 25px;
    border-radius: 0 0 16px 16px;
    border-top: 1px solid rgba(239, 68, 68, 0.3);
}

.danger-section h3 {
    color: var(--danger);
}

/* Payments List */
.payments-list {
    max-height: 300px;
    overflow-y: auto;
}

.payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

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

.payment-info {
    flex: 1;
}

.payment-info .reference {
    font-weight: 600;
}

.payment-info .payer {
    font-size: 13px;
    color: var(--text-muted);
}

.payment-amount {
    font-weight: 700;
    color: var(--success);
}

.payment-status {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    text-transform: uppercase;
}

.payment-status.completed {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.payment-status.pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.payment-status.cancelled,
.payment-status.expired {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

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

.modal-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 20px;
}

.warning-box {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid var(--warning);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: var(--warning);
    text-align: center;
}

.key-display {
    margin-bottom: 15px;
}

.key-display label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    color: var(--text-muted);
}

.key-value {
    display: flex;
    gap: 10px;
    align-items: center;
}

.key-value code {
    flex: 1;
    background: var(--bg-dark);
    padding: 12px;
    border-radius: 8px;
    font-family: 'Consolas', monospace;
    font-size: 13px;
    word-break: break-all;
}

/* Code Examples */
.code-example {
    margin-bottom: 20px;
}

.code-example h4 {
    margin-bottom: 10px;
    color: var(--text-muted);
}

.code-example pre {
    background: var(--bg-dark);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
}

.code-example code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: var(--primary);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    background: var(--bg-card);
    border-radius: 10px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: translateX(200%);
    transition: transform 0.3s;
    z-index: 1001;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.success {
    border-left-color: var(--success);
}

/* Test Section */
#testPaymentResult {
    margin-top: 15px;
    padding: 15px;
    background: var(--bg-input);
    border-radius: 8px;
}

#testPaymentResult a {
    color: var(--primary);
    word-break: break-all;
}

/* Utilities */
.loading {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

.hint {
    margin-top: 15px;
    font-size: 14px;
    color: var(--text-muted);
}

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

.empty {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

.shop-id {
    font-family: monospace;
    font-size: 12px;
    color: var(--text-muted);
}

.key-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin: 15px 0;
}

/* Steps */
.step {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border);
}

.step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

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

.step-content {
    flex: 1;
}

.step-content h3 {
    margin-bottom: 10px;
    font-size: 16px;
}

.step-content p {
    color: var(--text-muted);
    margin-bottom: 10px;
}

.step-content pre {
    background: var(--bg-dark);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-top: 10px;
}

.step-content code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: var(--primary);
}

/* Code Tabs */
.code-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.tab-btn {
    padding: 8px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: var(--border);
}

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content pre {
    background: var(--bg-dark);
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
}

.tab-content code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: #a5d6ff;
    white-space: pre;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .features {
        flex-direction: column;
        gap: 15px;
    }
    
    .shop-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .step {
        flex-direction: column;
        gap: 15px;
    }
    
    .code-tabs {
        flex-wrap: wrap;
    }
}
