/* Insecure Checkout Form Styles */

.insecure-checkout-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Security Warning */
.security-warning {
    background: #ff4444;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.http-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.warning-text {
    flex: 1;
}

/* Checkout Wrapper */
.checkout-wrapper {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    margin-top: 20px;
}

/* Form Styles */
.checkout-form-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.checkout-form-section h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
    font-size: 28px;
}

.form-section {
    margin-bottom: 30px;
}

.form-section h3 {
    margin-bottom: 20px;
    color: #555;
    font-size: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-group input.valid {
    border-color: #4CAF50;
    background-color: #f0f9f0;
}

.form-group input.invalid {
    border-color: #f44336;
    background-color: #fff5f5;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

/* Card Input Wrapper */
.card-input-wrapper {
    position: relative;
}

.card-input-wrapper input {
    padding-right: 50px;
}

.card-brand {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-brand.visible {
    opacity: 1;
}

.card-brand.visa {
    color: #1a1f71;
}

.card-brand.mastercard {
    color: #eb001b;
}

.card-brand.amex {
    color: #006fcf;
}

.card-brand.discover {
    color: #ff6000;
}

/* Error Messages */
.error-message {
    display: block;
    color: #f44336;
    font-size: 12px;
    margin-top: 5px;
    min-height: 18px;
}

/* Form Actions */
.form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.submit-button {
    width: 100%;
    padding: 16px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-button:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Order Summary */
.order-summary-section {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.order-summary-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.summary-items {
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #ddd;
}

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

.item-name {
    flex: 1;
    color: #333;
}

.item-quantity {
    color: #666;
    margin: 0 10px;
}

.item-price {
    font-weight: 600;
    color: #333;
}

.summary-total {
    padding-top: 15px;
    border-top: 2px solid #333;
    font-size: 20px;
    text-align: right;
}

.summary-empty {
    text-align: center;
    color: #666;
    padding: 20px 0;
}

.demo-note {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

/* Payment Failed Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 30px 30px 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.error-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 15px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.modal-header h2 {
    margin: 0;
    color: #f44336;
}

.modal-body {
    padding: 20px 30px;
    text-align: center;
    color: #666;
}

.modal-footer {
    padding: 20px 30px 30px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-footer button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-try-again {
    background: #4CAF50;
    color: white;
}

.btn-try-again:hover {
    background: #45a049;
}

.btn-contact-support {
    background: #2196F3;
    color: white;
}

.btn-contact-support:hover {
    background: #0b7dda;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .checkout-wrapper {
        grid-template-columns: 1fr;
    }
    
    .order-summary-section {
        position: static;
    }
}

@media (max-width: 768px) {
    .insecure-checkout-container {
        padding: 15px;
    }
    
    .checkout-form-section {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .insecure-checkout-container {
        padding: 10px;
    }
    
    .checkout-form-section {
        padding: 15px;
    }
    
    .checkout-form-section h2 {
        font-size: 24px;
    }
    
    .form-group input,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .submit-button {
        padding: 14px;
        font-size: 16px;
    }
    
    .security-warning {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
}

/* Data Viewer Styles */
.insecure-checkout-viewer {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.viewer-header h2 {
    margin: 0;
    color: #333;
}

.viewer-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 10px 20px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #0b7dda;
    transform: translateY(-2px);
}

.action-btn.danger {
    background: #f44336;
}

.action-btn.danger:hover {
    background: #d32f2f;
}

/* Statistics Dashboard */
.statistics-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

/* Debug Section */
.debug-section {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.debug-section h3 {
    margin-top: 0;
    color: #333;
}

.debug-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.debug-info p {
    margin: 5px 0;
    font-size: 14px;
}

.debug-info strong {
    color: #333;
}

/* Data Entries */
.data-entries-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.data-entries-section h3 {
    margin-top: 0;
    color: #333;
}

.loading-message,
.no-data {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.entries-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.entry-card {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.entry-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.entry-card.local {
    border-left: 4px solid #ff9800;
}

.entry-card.server {
    border-left: 4px solid #4CAF50;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
    flex-wrap: wrap;
    gap: 10px;
}

.entry-id {
    font-weight: bold;
    color: #333;
}

.entry-source {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-local {
    background: #ff9800;
    color: white;
}

.badge-server {
    background: #4CAF50;
    color: white;
}

.entry-date {
    color: #666;
    font-size: 14px;
}

.entry-body {
    display: grid;
    gap: 10px;
}

.entry-row {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.entry-row:last-child {
    border-bottom: none;
}

.entry-row strong {
    color: #333;
    margin-right: 8px;
}

.entry-row small {
    color: #666;
    font-size: 12px;
}

.cart-items {
    margin: 5px 0 0 20px;
    padding: 0;
    list-style: disc;
}

.cart-items li {
    margin: 5px 0;
    color: #666;
}

/* Responsive Data Viewer */
@media (max-width: 768px) {
    .insecure-checkout-viewer {
        padding: 15px;
    }
    
    .viewer-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .viewer-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
    
    .statistics-dashboard {
        grid-template-columns: 1fr;
    }
    
    .debug-info {
        grid-template-columns: 1fr;
    }
    
    .entry-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .insecure-checkout-viewer {
        padding: 10px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .entry-card {
        padding: 15px;
    }
}

