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

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

/* Top Navigation */
.top-nav {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 20px;
}

.nav-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #2d3748;
    font-size: 18px;
}

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

.nav-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #718096;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.nav-link:hover {
    color: #4299e1;
    background: #f7fafc;
}

.nav-link.active {
    color: #4299e1;
    background: #ebf8ff;
    border-color: #bee3f8;
}

.nav-link-icon {
    font-size: 16px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
}

.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: white;
    padding: 24px 20px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.header h1 {
    color: #2d3748;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.subtitle {
    color: #718096;
    font-size: 14px;
    font-weight: 500;
}

.form-section {
    padding: 20px;
}

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

.section-label {
    display: block;
    font-weight: 600;
    margin-bottom: 16px;
    color: #2d3748;
    font-size: 15px;
}

.cards-textarea {
    width: 100%;
    height: 200px;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: #fafafa;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    resize: vertical;
}

.cards-textarea:focus {
    outline: none;
    border-color: #4299e1;
    background: white;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.help-text {
    font-size: 12px;
    color: #718096;
    margin-top: 8px;
    font-weight: 500;
}

.divider {
    height: 1px;
    background: #e2e8f0;
    margin: 24px 0;
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.check-btn, .clear-btn, .export-btn {
    padding: 16px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.check-btn {
    background: #4299e1;
    color: white;
}

.check-btn:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.check-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

.clear-btn {
    background: #e53e3e;
    color: white;
}

.clear-btn:hover {
    background: #c53030;
    transform: translateY(-1px);
}

.export-btn {
    background: #48bb78;
    color: white;
    padding: 8px 16px;
    font-size: 13px;
}

.export-btn:hover {
    background: #38a169;
    transform: translateY(-1px);
}

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

/* Results Section */
.results-section {
    border-top: 1px solid #f0f0f0;
    padding: 24px 20px;
    display: none;
}

.results-section.active {
    display: block;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-header h3 {
    color: #2d3748;
    font-size: 18px;
    font-weight: 700;
}

.results-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cards-count {
    font-size: 13px;
    color: #718096;
    background: #f7fafc;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
}

/* Stats Container */
.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-item.live {
    background: #f0fff4;
    border: 2px solid #48bb78;
}

.stat-item.dead {
    background: #fff5f5;
    border: 2px solid #e53e3e;
}

.stat-item.unknown {
    background: #f7fafc;
    border: 2px solid #a0aec0;
}

.stat-count {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-item.live .stat-count {
    color: #48bb78;
}

.stat-item.dead .stat-count {
    color: #e53e3e;
}

.stat-item.unknown .stat-count {
    color: #718096;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-item.live .stat-label {
    color: #48bb78;
}

.stat-item.dead .stat-label {
    color: #e53e3e;
}

.stat-item.unknown .stat-label {
    color: #718096;
}

.cards-display {
    background: #f8fafc;
    border-radius: 12px;
    padding: 0;
    max-height: 500px;
    overflow-y: auto;
    border: 2px solid #e2e8f0;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #a0aec0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-text {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #718096;
}

.empty-subtext {
    font-size: 14px;
    color: #a0aec0;
}

/* Card Items - Matching Generator Style */
.card-item {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: #2d3748;
    background: white;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-item:hover {
    background: #f7fafc;
    transform: translateX(4px);
}

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

.card-item.copied {
    background: #ebf8ff;
    border-left: 4px solid #4299e1;
    animation: copyFlash 0.5s ease;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 60px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.status-live {
    background: #c6f6d5;
    color: #22543d;
}

.status-dead {
    background: #fed7d7;
    color: #742a2a;
}

.status-unknown {
    background: #e2e8f0;
    color: #4a5568;
}

.card-number {
    flex: 1;
    font-weight: 600;
    color: #2d3748;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.card-details {
    color: #718096;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.card-item::after {
    content: '📋';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.card-item:hover::after {
    opacity: 1;
}

/* Loading Overlay - Improved */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    min-width: 300px;
    border: 2px solid #e2e8f0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f1f5f9;
    border-top: 4px solid #4299e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.loading-progress {
    font-size: 16px;
    color: #4299e1;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

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

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #2d3748;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1001;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

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

.toast-text {
    font-size: 14px;
    font-weight: 500;
}

/* Footer */
.footer {
    background: #f8fafc;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.footer div {
    color: #718096;
    font-size: 13px;
}

.footer-link {
    color: #4299e1;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #3182ce;
    text-decoration: underline;
}

/* Animations */
@keyframes copyFlash {
    0% {
        background: #ebf8ff;
        border-left-color: #4299e1;
    }
    50% {
        background: #bee3f8;
        border-left-color: #3182ce;
    }
    100% {
        background: #ebf8ff;
        border-left-color: #4299e1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 16px;
    }
    
    .nav-brand .nav-title {
        display: none;
    }
    
    .nav-links {
        gap: 4px;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .nav-link span:last-child {
        display: none;
    }
    
    .nav-link-icon {
        font-size: 18px;
    }
    
    .container {
        max-width: 100%;
        padding: 0 16px;
    }
    
    .results-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .results-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .card-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .card-item::after {
        position: static;
        transform: none;
        opacity: 1;
    }
}

@media (max-width: 480px) {
    body {
        padding: 16px;
    }
    
    .cards-textarea {
        height: 150px;
    }
    
    .loading-content {
        min-width: auto;
        margin: 20px;
    }
}

/* Scrollbar styling */
.cards-display::-webkit-scrollbar {
    width: 6px;
}

.cards-display::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.cards-display::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}
