/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 500px;
}

.form-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    backdrop-filter: blur(10px);
}

h1 {
    color: #2d3748;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.description {
    color: #718096;
    text-align: center;
    margin-bottom: 32px;
    font-size: 16px;
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: #f7fafc;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="text"]:invalid,
input[type="password"]:invalid {
    border-color: #e53e3e;
}

input[type="text"]:valid,
input[type="password"]:valid {
    border-color: #38a169;
}

.help-text {
    display: block;
    color: #718096;
    font-size: 12px;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.btn-test {
    background: #38a169;
    color: white;
}

.btn-test:hover {
    background: #2f855a;
    transform: translateY(-1px);
}

.status-message {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    display: none;
}

.status-message.success {
    background: #f0fff4;
    color: #22543d;
    border: 1px solid #9ae6b4;
    display: block;
}

.status-message.error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
    display: block;
}

.status-message.info {
    background: #ebf8ff;
    color: #2a4365;
    border: 1px solid #90cdf4;
    display: block;
}

.key-display {
    margin-top: 32px;
    padding: 24px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.key-display h3 {
    color: #2d3748;
    margin-bottom: 16px;
    font-size: 18px;
}

.key-info {
    margin-bottom: 16px;
}

.key-item {
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.key-item:last-child {
    border-bottom: none;
}

.key-item strong {
    color: #4a5568;
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.key-item span {
    color: #2d3748;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    word-break: break-all;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    border: 1px solid #e2e8f0;
}

/* Loading state */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Button group styling */
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    align-items: flex-start;
}

.button-group .btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.btn-transactions {
    background: #4299e1;
    color: white;
}

.btn-transactions:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.btn-detailed {
    background: #9f7aea;
    color: white;
}

.btn-detailed:hover {
    background: #805ad5;
    transform: translateY(-1px);
}

.btn-analytics {
    background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(111, 66, 193, 0.4);
}

.btn-analytics:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(111, 66, 193, 0.6);
}

.btn-sales {
    background: linear-gradient(135deg, #00d4aa 0%, #009688 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.4);
}

.btn-sales:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 170, 0.6);
}

.btn-amazon {
    background: linear-gradient(135deg, #ff9900 0%, #ff6b00 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.4);
}

.btn-amazon:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.6);
}

/* Transactions display */
.transactions-display {
    margin-top: 32px;
    padding: 24px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.transactions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.transactions-header h3 {
    color: #2d3748;
    margin: 0;
    font-size: 18px;
}

.btn-refresh {
    background: #38a169;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    margin: 0;
}

.btn-refresh:hover {
    background: #2f855a;
    transform: translateY(-1px);
}

.transactions-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    color: #4a5568;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #4299e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

.transaction-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.transaction-id {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #4a5568;
    background: #f7fafc;
    padding: 2px 6px;
    border-radius: 4px;
}

.transaction-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-succeeded {
    background: #c6f6d5;
    color: #22543d;
}

.status-pending {
    background: #fef5e7;
    color: #744210;
}

.status-failed {
    background: #fed7d7;
    color: #742a2a;
}

.transaction-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.transaction-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}

.transaction-method {
    font-size: 11px;
    color: #718096;
    background: #f7fafc;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.receipt-link {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 8px;
    background: #4299e1;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.receipt-link:hover {
    background: #3182ce;
    text-decoration: none;
}


.transaction-amount {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
}

.transaction-description {
    color: #4a5568;
    font-size: 14px;
}

.transaction-date {
    color: #718096;
    font-size: 12px;
}

.no-transactions {
    text-align: center;
    color: #718096;
    padding: 40px 20px;
    font-style: italic;
}

/* Responsive design */
@media (max-width: 600px) {
    .form-card {
        padding: 24px;
        margin: 10px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        flex: none;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group .btn {
        flex: none;
    }
    
    .transaction-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .transaction-details {
        gap: 8px;
    }
}
