* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FF6B35;
    --primary-hover: #FF5722;
    --secondary-color: #FF8C42;
    --success-color: #00D9A3;
    --error-color: #FF4757;
    --warning-color: #FFA500;
    --bg-color: #FFF8F3;
    --card-bg: #FFFFFF;
    --text-primary: #2D3436;
    --text-secondary: #636E72;
    --border-color: #FFE4D6;
    --accent-light: #FFF5ED;
    --shadow-sm: 0 2px 4px rgba(255, 107, 53, 0.1);
    --shadow-md: 0 4px 12px rgba(255, 107, 53, 0.15);
    --shadow-lg: 0 8px 24px rgba(255, 107, 53, 0.2);
    --shadow-xl: 0 12px 32px rgba(255, 107, 53, 0.25);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #FF9A76 0%, #FF6B6B 50%, #FF8E53 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

.main-content {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 30px;
    align-items: start;
}

.left-panel {
    position: sticky;
    top: 20px;
}

.right-panel {
    min-height: 400px;
}

.right-panel .results-section {
    display: block !important;
}

.header {
    background: linear-gradient(135deg, #FFFFFF 0%, #FFF5ED 100%);
    padding: 35px 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    margin-bottom: 30px;
    text-align: center;
    border: 2px solid rgba(255, 107, 53, 0.1);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--primary-color));
    background-size: 200% 100%;
    animation: headerShine 3s linear infinite;
}

@keyframes headerShine {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo h1 {
    font-size: 36px;
    background: linear-gradient(135deg, #FF6B35, #FF8C42, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(255, 107, 53, 0.2);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

.input-section {
    background: linear-gradient(135deg, #FFFFFF 0%, #FFF5ED 100%);
    padding: 28px;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    border: 2px solid rgba(255, 107, 53, 0.1);
    transition: all 0.3s ease;
}

.input-section:hover {
    box-shadow: 0 16px 40px rgba(255, 107, 53, 0.3);
    transform: translateY(-2px);
}

.input-container {
    margin-bottom: 25px;
}

.input-container label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 15px;
}

#phoneInput {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
    resize: vertical;
    background: var(--accent-light);
    min-height: 200px;
    max-height: 600px;
    line-height: 1.6;
}

#phoneInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.15);
    background: #FFFFFF;
    transform: translateY(-1px);
}

.input-actions {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: white;
    flex: 1;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: #F3F4F6;
    color: var(--text-primary);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 10px 20px;
    font-size: 14px;
}

.btn-outline:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.stats-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-card {
    background: linear-gradient(135deg, #FFFFFF 0%, var(--accent-light) 100%);
    padding: 20px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
}

.stat-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.25);
    border-color: var(--primary-color);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-icon-total {
    background: linear-gradient(135deg, #FF8C42, #FFA500);
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.4);
}

.stat-icon-success {
    background: linear-gradient(135deg, #00D9A3, #00B894);
    box-shadow: 0 4px 12px rgba(0, 217, 163, 0.4);
}

.stat-icon-error {
    background: linear-gradient(135deg, #FF4757, #FF3838);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.results-section {
    background: linear-gradient(135deg, #FFFFFF 0%, #FFF5ED 100%);
    padding: 28px;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    min-height: 400px;
    border: 2px solid rgba(255, 107, 53, 0.1);
    transition: all 0.3s ease;
}

.results-section:hover {
    box-shadow: 0 16px 40px rgba(255, 107, 53, 0.3);
}

.results-section.has-results {
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.results-header h2 {
    font-size: 24px;
    color: var(--text-primary);
}

.results-actions {
    display: flex;
    gap: 10px;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 400px);
    overflow-y: auto;
    padding-right: 5px;
}

.results-section.empty::before {
    content: '';
    display: block;
    width: 120px;
    height: 120px;
    margin: 60px auto 20px;
    background: linear-gradient(135deg, #E0E7FF, #C7D2FE);
    border-radius: 50%;
    position: relative;
    opacity: 0.5;
}

.results-section.empty::after {
    content: 'Nhập số điện thoại và nhấn "Kiểm tra ngay" để xem kết quả';
    display: block;
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    margin-top: 20px;
    padding: 0 40px;
}

.results-section.has-results::before,
.results-section.has-results::after {
    display: none;
}

.results-section.empty .results-header {
    display: none;
}

.results-section.empty .results-container {
    display: none;
}

.results-section.empty .local-loading {
    display: none !important;
}

.local-loading {
    text-align: center;
    padding: 60px 20px;
}

.local-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-right-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.2);
}

.local-loading p {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

.local-loading-batch {
    color: var(--text-secondary) !important;
    font-size: 13px !important;
    font-weight: 400 !important;
}

.local-progress-bar {
    width: 100%;
    max-width: 400px;
    height: 10px;
    background: var(--accent-light);
    border-radius: 12px;
    margin: 20px auto 0;
    overflow: hidden;
    border: 2px solid var(--border-color);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.local-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF6B35, #FF8C42, #FFA500);
    background-size: 200% 100%;
    animation: progressShine 2s linear infinite;
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
}

@keyframes progressShine {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.result-card {
    background: linear-gradient(135deg, #FFFFFF 0%, var(--accent-light) 100%);
    border-radius: 14px;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.result-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-card:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.25);
    border-color: var(--primary-color);
}

.result-card:hover::before {
    width: 4px;
}

.result-card.success {
    border-left: 4px solid var(--success-color);
}

.result-card.success:hover {
    border-left-color: var(--success-color);
    box-shadow: 0 8px 24px rgba(0, 217, 163, 0.25);
}

.result-card.error {
    border-left: 4px solid var(--error-color);
}

.result-card.error:hover {
    border-left-color: var(--error-color);
    box-shadow: 0 8px 24px rgba(255, 71, 87, 0.25);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.result-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.result-avatar.placeholder {
    background: linear-gradient(135deg, #CBD5E1, #94A3B8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 700;
}

.result-basic {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.result-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-phone {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

.result-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
}

.result-status.success {
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
    color: #065F46;
    font-weight: 700;
}

.result-status.error {
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
    color: #991B1B;
    font-weight: 700;
}

.result-details {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.result-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.result-info svg {
    flex-shrink: 0;
    margin-top: 2px;
    opacity: 0.6;
    width: 16px;
    height: 16px;
}

.result-info-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 70px;
    font-size: 12px;
}

.result-info-value {
    color: var(--text-primary);
    flex: 1;
    word-break: break-word;
    font-size: 13px;
}

.result-cover {
    display: none;
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
}

.result-cover img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.error-message {
    color: var(--error-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    flex: 1;
    min-width: 0;
}

.error-message svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.result-info-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.result-info-inline span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-top: 20px;
}

.loading-batch {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 14px !important;
    margin-top: 10px !important;
}

.progress-bar {
    width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin-top: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4F46E5, #7C3AED);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .left-panel {
        position: static;
    }

    .header {
        padding: 30px;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        padding: 25px;
    }

    .logo h1 {
        font-size: 24px;
    }

    .subtitle {
        font-size: 14px;
    }

    .input-section {
        padding: 20px;
    }

    .input-actions {
        flex-direction: column;
    }

    .results-section {
        padding: 20px;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .results-actions {
        width: 100%;
        flex-direction: column;
    }

    .results-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-icon {
        width: 45px;
        height: 45px;
    }

    .stat-value {
        font-size: 24px;
    }

    .result-card {
        padding: 10px 12px;
        gap: 10px;
    }

    .result-avatar {
        width: 36px;
        height: 36px;
    }

    .result-avatar.placeholder {
        font-size: 14px;
    }

    .result-name {
        font-size: 14px;
    }

    .result-info-inline {
        font-size: 11px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .result-status {
        font-size: 10px;
        padding: 3px 8px;
    }

    .result-status svg {
        width: 12px;
        height: 12px;
    }

    .results-section.empty::after {
        font-size: 14px;
        padding: 0 20px;
    }

    .local-loading {
        padding: 40px 15px;
    }

    .local-loading-spinner {
        width: 40px;
        height: 40px;
    }

    .local-loading p {
        font-size: 14px;
    }

    .local-progress-bar {
        max-width: 100%;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--accent-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #FF6B35, #FF8C42);
    border-radius: 10px;
    border: 2px solid var(--accent-light);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #FF5722, #FF6B35);
    border-color: var(--bg-color);
}

