/* ===================================
   MOJA KARTICA - DIGITAL CARD STYLES
   QR Code & Barcode Display
   Two Cards System
   =================================== */

/* Card Tabs */
.card-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 10px;
}

.card-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--card-bg);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.card-tab:hover {
    border-color: var(--primary-color);
    background: rgba(233, 30, 99, 0.03);
}

.card-tab.active {
    border-color: var(--primary-color);
    background: rgba(233, 30, 99, 0.08);
    color: var(--primary-color);
}

.card-tab span {
    font-size: 18px;
}

/* Card Badge */
.card-badge {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 20px;
    margin-bottom: 15px;
}

.card-badge.store {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

/* Card Panel (show/hide) */
.card-panel {
    display: none;
}

.card-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.web-shop-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.web-shop-link-item:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.22);
}

.web-shop-link-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.web-shop-link-thumb-card {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    font-size: 18px;
}

.web-shop-link-copy {
    flex: 1;
}

.web-shop-link-title {
    font-weight: 600;
    font-size: 14px;
}

.web-shop-link-meta {
    font-size: 11px;
    opacity: 0.7;
}

.web-shop-link-icon {
    font-size: 18px;
}

/* Card Style Variants */
.card-web-style {
    border-color: #2196F3;
}

.card-web-style .card-qr-section canvas,
.card-web-style .card-barcode-section canvas {
    border-color: #2196F3;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.15);
}

.card-web-style .code-value {
    border-color: #2196F3;
}

.card-store-style {
    border-color: var(--primary-color);
}

/* Card Usage Info */
.card-usage-info {
    margin-top: 15px;
    padding: 12px 15px;
    background: var(--bg-color);
    border-radius: var(--border-radius-sm);
    text-align: center;
}

.card-usage-info p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Card Container */
.card-container {
    max-width: 420px;
    margin: 0 auto;
    padding: 10px;
    animation: slideInUp 0.5s ease backwards;
}

/* Digital Card */
.digital-card {
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    border-radius: 16px;
    padding: 25px 20px;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.digital-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.08),
        transparent
    );
    transition: left 0.6s ease;
}

.digital-card:hover::before {
    left: 100%;
}

.digital-card:hover {
    box-shadow: 0 12px 35px rgba(233, 30, 99, 0.15);
    transform: translateY(-4px);
}

/* Card Web Animation */
.card-web-style {
    animation: borderGlow 3s ease infinite;
}

/* Card Store Animation */
.card-store-style {
    animation: borderGlow 3s ease infinite 1.5s;
}

/* Card Header */
.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--bg-color);
}

.card-icon {
    font-size: 48px;
    margin-right: 15px;
    flex-shrink: 0;
}

.card-info {
    flex: 1;
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 5px 0;
}

.card-owner {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.card-owner strong {
    color: var(--primary-color);
}

/* Code Section */
.card-code-section {
    text-align: center;
    margin: 25px 0;
}

.code-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.code-value {
    font-size: 28px;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: 4px;
    padding: 18px 15px;
    background: var(--bg-color);
    border: 3px solid var(--primary-color);
    border-radius: 12px;
    font-family: 'Courier New', Consolas, monospace;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.05);
    user-select: all;
    -webkit-user-select: all;
}

/* QR Code Section */
.card-qr-section {
    text-align: center;
    margin: 30px 0;
}

.code-type-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-qr-section canvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    width: auto !important;
    height: auto !important;
    border: 3px solid var(--primary-color);
    border-radius: 12px;
    padding: 15px;
    background: #fff;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.15);
}

/* Barcode Section */
.card-barcode-section {
    text-align: center;
    margin: 30px 0;
}

.card-barcode-section canvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    width: 100% !important;
    height: auto;
    border: 3px solid var(--primary-color);
    border-radius: 12px;
    padding: 15px;
    background: #fff;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.15);
}

/* Timer */
.card-timer {
    text-align: center;
    padding: 18px;
    margin: 25px 0 0 0;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.timer-icon {
    font-size: 22px;
}

.timer-countdown {
    font-size: 32px;
    font-weight: 900;
    color: var(--primary-color);
    min-width: 60px;
    display: inline-block;
    transition: color var(--transition-fast);
}

.timer-countdown.low-time {
    color: var(--error-color);
    animation: timerPulse 1s infinite;
}

@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.timer-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Card Actions */
.card-actions {
    display: flex;
    gap: 12px;
    max-width: 420px;
    margin: 20px auto 0;
    padding: 0 10px;
}

.btn-refresh,
.btn-share {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-refresh {
    background: var(--primary-color);
    color: #fff;
}

.btn-refresh:active {
    background: var(--primary-dark);
    transform: scale(0.98);
}

.btn-share {
    background: var(--card-bg);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-share:active {
    background: rgba(233, 30, 99, 0.1);
    transform: scale(0.98);
}

/* Scanner Page */
.scanner-container {
    max-width: 500px;
    margin: 0 auto;
}

.scanner-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-height: 400px;
    background: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 20px;
}

#scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scanner-frame {
    width: 70%;
    height: 70%;
    border: 3px solid var(--primary-color);
    border-radius: 20px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

.scanner-line {
    position: absolute;
    top: 15%;
    left: 15%;
    width: 70%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    animation: scanLine 2s ease-in-out infinite;
}

@keyframes scanLine {
    0%, 100% { top: 15%; }
    50% { top: 80%; }
}

.scanner-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

.scan-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background: var(--primary-color);
    color: #fff;
    transition: all var(--transition-fast);
}

.scan-btn:active {
    transform: scale(0.98);
}

/* Manual Input */
.manual-input {
    background: var(--card-bg);
    padding: 25px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.manual-input h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--text-primary);
    text-align: center;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.verify-btn {
    padding: 14px 24px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

/* Verification Result */
.verification-result {
    text-align: center;
    padding: 30px 20px;
    border-radius: var(--border-radius);
    margin-top: 20px;
    animation: fadeIn 0.3s ease;
}

.verification-result.success {
    background: #e8f5e9;
    border: 2px solid var(--success-color);
}

.verification-result.error {
    background: #ffebee;
    border: 2px solid var(--error-color);
}

/* Partner Stats (Scanner) */
.partner-stats {
    margin-top: 20px;
    padding: 18px 16px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.partner-stats h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-primary);
    text-align: center;
}

.partner-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.partner-stat {
    text-align: center;
    padding: 12px 10px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
}

.partner-stat .stat-num {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.1;
}

.partner-stat .stat-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.result-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.verification-result.success .result-icon::after {
    content: '✅';
}

.verification-result.error .result-icon::after {
    content: '❌';
}

.result-message {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.verification-result.success .result-message {
    color: var(--success-color);
}

.verification-result.error .result-message {
    color: var(--error-color);
}

.result-details {
    font-size: 14px;
    color: var(--text-secondary);
}

.result-details p {
    margin: 5px 0;
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    .card-container {
        padding: 5px;
    }
    
    .digital-card {
        padding: 20px 15px;
    }
    
    .card-icon {
        font-size: 40px;
    }
    
    .card-title {
        font-size: 18px;
    }
    
    .code-value {
        font-size: 22px;
        letter-spacing: 3px;
        padding: 15px 10px;
    }
    
    .timer-countdown {
        font-size: 26px;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .input-group {
        flex-direction: column;
    }
}

/* Landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .card-container {
        display: flex;
        gap: 20px;
    }
    
    .digital-card {
        flex: 1;
        min-width: 0;
    }
    
    .card-qr-section canvas,
    .card-barcode-section canvas {
        max-width: 200px;
    }
}

/* ===================================
   EXPANDABLE QR/BARCODE SECTION
   =================================== */

.card-codes-expandable {
    margin: 15px 0;
    padding: 0 10px;
}

.expand-codes-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.1), rgba(156, 39, 176, 0.1));
    border: 2px dashed var(--primary-color);
    border-radius: var(--border-radius-sm);
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.expand-codes-btn:hover {
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.15), rgba(156, 39, 176, 0.15));
    border-style: solid;
}

.expand-codes-btn .expand-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.codes-container {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--border-radius-sm);
    animation: slideDown 0.3s ease;
}

.codes-container.hidden {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.codes-container .card-qr-section,
.codes-container .card-barcode-section {
    margin-bottom: 15px;
}

.codes-container .card-qr-section:last-child,
.codes-container .card-barcode-section:last-child {
    margin-bottom: 0;
}
