* {
    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;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    padding: 30px;
    min-height: 600px;
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.panel h3 {
    color: #1f2937;
    margin-bottom: 15px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.input-field:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.file-upload {
    border: 3px dashed #d1d5db;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f9fafb;
}

.file-upload:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.file-upload.dragover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: scale(1.02);
}

.btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.btn-success:hover {
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.right-panel {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    position: relative;
    overflow: hidden;
}

.pdf-viewer {
    height: 100%;
    overflow: auto;
    padding: 20px;
    position: relative;
}

.pdf-page {
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pdf-canvas {
    display: block;
    width: 100%;
    height: auto;
    cursor: crosshair;
}

.image-marker {
    position: absolute;
    border: 3px solid #ef4444;
    background: rgba(239, 68, 68, 0.1);
    cursor: move;
    border-radius: 5px;
    min-width: 20px;
    min-height: 20px;
}

.image-marker::after {
    content: "📷 ";
    position: absolute;
    top: -25px;
    left: 0;
    background: #ef4444;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.marker-controls {
    position: absolute;
    top: -30px;
    right: 0;
    display: flex;
    gap: 2px;
}

.marker-btn {
    background: #ef4444;
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.status {
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
    font-weight: 500;
}

.status.loading {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.status.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.status.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.tools-bar {
    background: #f8fafc;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
    align-items: center;
}

.tool-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: #f3f4f6;
}

.tool-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    width: 0%;
    transition: width 0.3s ease;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 2rem;
    }
}

.no-pdf-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6b7280;
    text-align: center;
}

.no-pdf-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.marker-preview {
    opacity: 0.7;
    border-style: dashed !important;
}







/* Header Buttons - Colorful Version */
.header-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.header-btn {
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* Hiá»‡u á»©ng shine khi hover */
.header-btn::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;
}

.header-btn:hover::before {
    left: 100%;
}

.header-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.header-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.header-btn span {
    font-size: 18px;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

/* MÃ u sáº¯c riÃªng cho tá»«ng nÃºt */
.header-btn:nth-child(1) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.header-btn:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation: pulse 2s infinite;
}

.header-btn:nth-child(3) {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.header-btn:nth-child(4) {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.header-btn:nth-child(5) {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Animation cho nÃºt API Máº«u */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(240, 147, 251, 0.8);
    }
    100% {
        box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
    }
}

/* Responsive cho mobile */
@media (max-width: 768px) {
    .header-buttons {
        gap: 8px;
        padding: 0 10px;
    }
    
    .header-btn {
        padding: 8px 14px;
        font-size: 12px;
        flex: 0 0 calc(50% - 4px);
    }
    
    .header-btn span {
        font-size: 16px;
    }
}

/* ThÃªm hiá»‡u á»©ng ná»•i báº­t khi trang load */
.header-buttons {
    animation: slideInDown 0.6s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tooltip khi hover */
.header-btn[title] {
    position: relative;
}

.header-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}













.conversion-stats {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 12px 20px;
    margin: 15px auto 0 auto;
    display: inline-block;
    color: white;
    font-size: 16px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.8s ease-out;
}

.conversion-stats strong {
    color: #fbbf24;
    font-size: 18px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes countUp {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.counter-animate {
    animation: countUp 0.5s ease-in-out;
}










/* Xóa API Key cũ */
@media (max-width: 768px) {
    #clearApiKey {
        margin-left: 0 !important;
        margin-top: 10px;
        width: 100%;
    }
}