/* eSIM Redeem Codes & QR Codes Styling */

:root {
    --esim-primary: #0CE06B;
    --esim-primary-dark: #0AAE5A;
    --esim-secondary: #1a1a1a;
    --esim-gray-light: #f8f9fa;
    --esim-gray-medium: #e9ecef;
    --esim-gray-dark: #6c757d;
    --esim-success: #28a745;
    --esim-warning: #ffc107;
    --esim-danger: #dc3545;
    --esim-info: #17a2b8;
    --esim-border-radius: 12px;
    --esim-shadow: 0 4px 15px rgba(12, 224, 107, 0.1);
    --esim-shadow-hover: 0 8px 25px rgba(12, 224, 107, 0.15);
}

/* Light theme variables */
body.light-theme {
    --esim-secondary: #1a1a1a;
    --esim-gray-light: #f8f9fa;
    --esim-gray-medium: #e9ecef;
    --esim-gray-dark: #6c757d;
    --esim-bg: #ffffff;
    --esim-card-bg: #ffffff;
    --esim-text: #1a1a1a;
    --esim-border: rgba(0, 0, 0, 0.1);
}

/* Dark theme variables (default) */
body:not(.light-theme) {
    --esim-secondary: #ffffff;
    --esim-gray-light: #2c2c2c;
    --esim-gray-medium: #3a3a3a;
    --esim-gray-dark: #aaaaaa;
    --esim-bg: #1a1a1a;
    --esim-card-bg: #252525;
    --esim-text: #ffffff;
    --esim-border: rgba(255, 255, 255, 0.1);
}

/* Main container */
.esim-view-order {
    max-width: 100%;
    margin: 0 auto;
}

.order-status-summary {
    background: linear-gradient(135deg, rgba(12, 224, 107, 0.05) 0%, rgba(12, 224, 107, 0.02) 100%);
    border: 1px solid rgba(12, 224, 107, 0.2);
    border-radius: var(--esim-border-radius);
    padding: 20px;
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--esim-text);
    background-color: var(--esim-card-bg);
}

/* eSIM codes section */
.esim-codes-section {
    background: var(--esim-card-bg);
    border-radius: var(--esim-border-radius);
    box-shadow: var(--esim-shadow);
    margin: 30px 0;
    padding: 30px;
    border: 1px solid rgba(12, 224, 107, 0.1);
}

.esim-codes-title {
    color: var(--esim-secondary);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

/* Info box */
.esim-info-box {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.08) 0%, rgba(40, 167, 69, 0.04) 100%);
    border: 1px solid rgba(40, 167, 69, 0.25);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 25px;
    background-color: rgba(40, 167, 69, 0.05);
}

.esim-info-text {
    margin: 0;
    color: var(--esim-text);
    line-height: 1.6;
}

/* Plan group */
.esim-plan-group {
    margin-bottom: 30px;
    border: 1px solid var(--esim-border);
    border-radius: var(--esim-border-radius);
    overflow: hidden;
    background-color: var(--esim-card-bg);
}

.esim-plan-name {
    background: linear-gradient(135deg, var(--esim-primary) 0%, var(--esim-primary-dark) 100%);
    color: white;
    margin: 0;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.esim-plan-name .plan-name-text {
    color: white !important;
    font-weight: 600;
}

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

/* Code card */
.esim-code-card {
    padding: 20px;
    border-bottom: 1px solid var(--esim-border);
    transition: all 0.3s ease;
    background-color: var(--esim-card-bg);
}

.esim-code-card:last-child {
    border-bottom: none;
}

.esim-code-card:hover {
    background-color: rgba(12, 224, 107, 0.02);
}

/* Code header */
.esim-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.esim-code-label {
    font-weight: 600;
    color: var(--esim-text);
}

/* Status labels */
.esim-code-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-available {
    background: var(--esim-success);
    color: white;
}

.status-processing {
    background: var(--esim-warning);
    color: white;
}

.status-used {
    background: var(--esim-gray-dark);
    color: white;
}

.status-failed {
    background: var(--esim-danger);
    color: white;
}

.status-unknown {
    background: var(--esim-info);
    color: white;
}

/* Code content */
.esim-code-content {
    margin-bottom: 15px;
}

.esim-code-value {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 12px;
    background: var(--esim-gray-light);
    border-radius: 8px;
    border: 1px solid var(--esim-border);
}

.esim-code-value code {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--esim-text);
    background: none;
    padding: 0;
    flex: 1;
    word-break: break-all;
}

/* Copy button */
.copy-code-btn {
    background: var(--esim-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

/* Expiration date */
.esim-code-expire {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--esim-gray-dark);
}

.expire-icon {
    font-size: 16px;
}

/* QR code section */
.esim-qr-section {
    margin-top: 15px;
    padding: 15px;
    background: rgba(12, 224, 107, 0.02);
    border: 1px solid rgba(12, 224, 107, 0.1);
    border-radius: 8px;
    background-color: var(--esim-card-bg);
}

.generate-qr-btn {
    background: linear-gradient(135deg, var(--esim-primary) 0%, var(--esim-primary-dark) 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.generate-qr-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(12, 224, 107, 0.3);
}

/* QR code results */
.qr-code-result {
    margin-top: 15px;
}

.qr-loading {
    text-align: center;
    padding: 20px;
    color: var(--esim-gray-dark);
    font-style: italic;
}

.qr-code-success {
    text-align: center;
    padding: 20px;
}

.esim-qr-image {
    max-width: 200px;
    height: auto;
    margin: 15px 0;
    border: 2px solid var(--esim-border);
    border-radius: 8px;
    box-shadow: var(--esim-shadow);
}

.qr-code-error {
    text-align: center;
    padding: 20px;
    color: var(--esim-danger);
}

.retry-btn {
    background: var(--esim-danger);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 10px;
}

.retry-btn:hover {
    background: #c82333;
}

/* Usage instructions */
.esim-usage-instructions {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, rgba(12, 224, 107, 0.03) 0%, rgba(12, 224, 107, 0.01) 100%);
    border: 1px solid rgba(12, 224, 107, 0.15);
    border-radius: var(--esim-border-radius);
    background-color: var(--esim-card-bg);
}

.esim-usage-instructions h4 {
    color: var(--esim-text);
    margin-bottom: 15px;
    font-size: 18px;
}

.esim-usage-instructions ol {
    padding-left: 20px;
    margin-bottom: 15px;
}

.esim-usage-instructions li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: var(--esim-text);
}

.warning-text {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 15px;
    color: #856404;
}

/* Loading boxes */
.esim-loading-box,
.esim-pending-box,
.esim-error-box {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(12, 224, 107, 0.05) 0%, rgba(12, 224, 107, 0.02) 100%);
    border: 2px solid rgba(12, 224, 107, 0.2);
    border-radius: var(--esim-border-radius);
    background-color: var(--esim-card-bg);
    color: var(--esim-text);
}

.esim-error-box {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.05) 0%, rgba(220, 53, 69, 0.02) 100%);
    border-color: rgba(220, 53, 69, 0.2);
}

.esim-loading-box h3,
.esim-pending-box h3,
.esim-error-box h3 {
    color: var(--esim-text);
    margin-bottom: 15px;
}

.esim-error-box h3 {
    color: var(--esim-danger);
}

/* Processing steps */
.processing-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: rgba(12, 224, 107, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(12, 224, 107, 0.1);
    min-width: 120px;
    text-align: center;
    background-color: var(--esim-card-bg);
}

.step-icon {
    font-size: 24px;
}

.step-text {
    font-size: 12px;
    color: var(--esim-gray-dark);
    font-weight: 500;
}

/* Error boxes special styles */
.error-details {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    text-align: left;
    color: var(--esim-text);
    background-color: var(--esim-card-bg);
}

.esim-help-actions {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
    background-color: var(--esim-card-bg);
}

.esim-help-actions h4 {
    color: var(--esim-text);
    margin-bottom: 10px;
}

.esim-help-actions ol {
    padding-left: 20px;
    margin: 0;
}

.esim-help-actions li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: var(--esim-text);
}

.esim-contact-info {
    background: rgba(12, 224, 107, 0.05);
    border: 1px solid rgba(12, 224, 107, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    text-align: left;
    background-color: var(--esim-card-bg);
}

.esim-contact-info ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.esim-contact-info li {
    padding: 4px 0;
    color: var(--esim-text);
}

.refresh-btn {
    background: var(--esim-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
}

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

/* Order notes section */
.order-notes-section {
    margin-top: 40px;
    padding: 25px;
    background: var(--esim-card-bg);
    border-radius: var(--esim-border-radius);
    box-shadow: var(--esim-shadow);
}

.order-notes-section h2 {
    color: var(--esim-text);
    font-size: 20px;
    margin-bottom: 20px;
}

/* Copy feedback */
.copy-feedback {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .esim-codes-section {
        padding: 20px 15px;
        margin: 20px 0;
    }
    
    .esim-codes-title {
        font-size: 20px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .esim-code-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .esim-code-value {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .esim-code-value code {
        word-break: break-all;
        text-align: center;
        padding: 8px;
        background: var(--esim-gray-light);
        border-radius: 4px;
    }
    
    .copy-code-btn {
        width: 100%;
        justify-content: center;
    }
    
    .generate-qr-btn {
        width: 100%;
        justify-content: center;
    }
    
    .esim-qr-image {
        max-width: 150px;
    }
    
    .esim-usage-instructions {
        padding: 20px 15px;
    }
    
    .order-status-summary {
        padding: 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .esim-plan-name {
        font-size: 16px;
        padding: 12px 15px;
    }
    
    .esim-code-card {
        padding: 15px;
    }
    
    .esim-codes-title {
        font-size: 18px;
    }
    
    .esim-qr-image {
        max-width: 120px;
    }
}

/* Print styles */
@media print {
    .esim-view-order {
        background: white !important;
        color: black !important;
    }
    
    .generate-qr-btn,
    .copy-code-btn,
    .refresh-btn,
    .retry-btn {
        display: none !important;
    }
    
    .esim-qr-section {
        background: white !important;
    }
    
    .esim-qr-image {
        max-width: 150px;
        border: 2px solid #ccc;
    }
}