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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 300;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.search-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.search-box {
    display: flex;
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
}

#cardInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#cardInput:focus {
    outline: none;
    border-color: #667eea;
}

#searchBtn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#searchBtn:hover {
    transform: translateY(-2px);
}

.loading {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: #ff6b6b;
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
}

.card-info {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.card-visual {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.card {
    width: 350px;
    height: 220px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 15px;
    padding: 25px;
    color: white;
    position: relative;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
}

.contactless-icon {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 24px;
    opacity: 0.7;
}

.card-chip {
    width: 45px;
    height: 35px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-radius: 5px;
    margin-bottom: 30px;
    position: relative;
}

.card-chip::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 20px;
    background: repeating-linear-gradient(
        90deg,
        #d4af37 0px,
        #d4af37 2px,
        transparent 2px,
        transparent 4px
    );
}

.card-number {
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 3px;
    margin-bottom: 25px;
    font-family: 'Courier New', monospace;
}

.card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.card-cvv, .card-expiry {
    display: flex;
    flex-direction: column;
    font-size: 12px;
}

.card-cvv span:first-child,
.card-expiry span:first-child {
    opacity: 0.7;
    margin-bottom: 5px;
}

.card-cvv span:last-child,
.card-expiry span:last-child {
    font-size: 16px;
    font-weight: 500;
}

.card-logo {
    font-size: 24px;
    font-weight: bold;
    font-style: italic;
}

.card-details h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.detail-item .label {
    font-weight: 600;
    color: #555;
}

.detail-item .value {
    color: #333;
    font-weight: 500;
}

.balance-info {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
    text-align: center;
}

.balance-info h4 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    opacity: 0.9;
}

.balance-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.balance-label {
    font-size: 16px;
    opacity: 0.8;
}

.balance-amount {
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.account-info {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #e9ecef;
}

.account-info h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.transaction-history {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.transaction-history h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.pagination-info {
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

.transaction-table {
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    position: sticky;
    top: 0;
}

tr:hover {
    background: #f8f9fa;
}

.transaction-type {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.type-consumption {
    background: #fff3cd;
    color: #856404;
}

.type-transferin {
    background: #d4edda;
    color: #155724;
}

.type-transferout {
    background: #f8d7da;
    color: #721c24;
}

.type-credit {
    background: #d1ecf1;
    color: #0c5460;
}

.type-reversal {
    background: #e2e3e5;
    color: #383d41;
}

.type-frozen {
    background: #f8d7da;
    color: #721c24;
}

.type-unfrozen {
    background: #d4edda;
    color: #155724;
}

.type-fee_consumption {
    background: #ffeaa7;
    color: #6c5ce7;
}

.type-createcardfee {
    background: #fab1a0;
    color: #e17055;
}

.transaction-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-closed {
    background: #d1ecf1;
    color: #0c5460;
}

.status-success {
    background: #d4edda;
    color: #155724;
}

.status-failed, .status-fail {
    background: #f8d7da;
    color: #721c24;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-cancelled {
    background: #f5c6cb;
    color: #721c24;
}

.status-refunded {
    background: #d4edda;
    color: #155724;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.page-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    background: #5a67d8;
}

.page-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#pageInfo {
    font-weight: 500;
    color: #555;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .card {
        width: 100%;
        max-width: 350px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-item {
        flex-direction: column;
        gap: 5px;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 8px 10px;
    }
}