/* Reset và thiết lập cơ bản */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 10px;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container chính */
.container {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 20px;
}

/* Desktop và tablet lớn */
@media (min-width: 769px) {
    .container {
        padding: 35px;
    }

    header {
        margin-bottom: 35px;
        padding-bottom: 20px;
        border-bottom: 4px solid #667eea;
    }

    header h1 {
        font-size: 30px;
        font-weight: 800;
        letter-spacing: 1.5px;
        line-height: 1.3;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    }
}

/* Tiêu đề chính */
header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 4px solid #667eea;
}

header h1 {
    font-size: 22px;
    color: #1a1a1a;
    font-weight: 800;
    letter-spacing: 0.8px;
    line-height: 1.3;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin: 0;
}

/* Mỗi bước hướng dẫn */
.step {
    margin-bottom: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 18px;
    border-left: 4px solid #667eea;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step:last-child {
    margin-bottom: 0;
}

@media (hover: hover) and (pointer: fine) {
    .step:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
}

/* Header của mỗi bước */
.step-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 12px;
}

.step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
}

.step h2 {
    font-size: 17px;
    color: #333;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

/* Nội dung bước */
.step-content {
    padding-left: 0;
}

.step-content p {
    margin-bottom: 12px;
    font-size: 15px;
    color: #555;
    line-height: 1.5;
}

.step-content p:last-child {
    margin-bottom: 0;
}

/* Ô hiển thị mã API */
.api-code-box {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.api-code-content {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.api-code-content code {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #333;
    word-break: break-all;
    display: block;
    white-space: pre-wrap;
}

/* Nút Copy */
.copy-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: stretch;
    width: 100%;
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
}

.copy-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

@media (hover: hover) and (pointer: fine) {
    .copy-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
        background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    }
    
    .copy-btn:active:hover {
        transform: scale(0.98);
    }
}

/* Thông báo copy thành công */
.copy-notification {
    display: none;
    background: #4caf50;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-top: 10px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    animation: slideIn 0.3s ease;
}

.copy-notification.show {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Lưu ý cảnh báo (màu đỏ) */
.warning-note {
    background: #ffebee;
    border-left: 4px solid #f44336;
    padding: 12px;
    margin: 15px 0;
    border-radius: 5px;
}

.warning-note strong {
    color: #d32f2f;
    font-size: 14px;
    line-height: 1.5;
    display: block;
}

/* Lưu ý quan trọng */
.important-note {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    padding: 12px;
    margin: 15px 0;
    border-radius: 5px;
}

.important-note p {
    margin-bottom: 10px;
    font-weight: 600;
    color: #e65100;
    font-size: 14px;
}

.important-note ul {
    margin-left: 18px;
    color: #555;
    font-size: 14px;
}

.important-note li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Thông báo thành công (màu xanh) */
.success-note {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    padding: 12px;
    margin: 15px 0;
    border-radius: 5px;
}

.success-note p {
    margin-bottom: 10px;
    color: #2e7d32;
    font-size: 14px;
    line-height: 1.5;
}

.success-note strong {
    color: #1b5e20;
    font-size: 14px;
}

/* Container video */
.video-container {
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    position: relative;
    width: 100%;
}

.video-container video {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
    outline: none;
}

/* Đảm bảo video có controls tốt trên mobile */
.video-container video::-webkit-media-controls {
    display: flex;
}

.video-container video::-webkit-media-controls-play-button {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
}

/* Responsive cho tablet */
@media (min-width: 481px) and (max-width: 768px) {
    body {
        padding: 15px;
    }

    .container {
        padding: 25px;
        border-radius: 12px;
    }

    header {
        margin-bottom: 30px;
        padding-bottom: 18px;
        border-bottom: 4px solid #667eea;
    }

    header h1 {
        font-size: 24px;
        font-weight: 800;
        letter-spacing: 1px;
    }

    .step {
        padding: 20px;
        margin-bottom: 30px;
    }

    .step h2 {
        font-size: 18px;
    }

    .step-content {
        padding-left: 47px;
    }

    .step-number {
        width: 38px;
        height: 38px;
        font-size: 19px;
    }

    .api-code-content code {
        font-size: 13px;
    }

    .copy-btn {
        width: auto;
        align-self: flex-start;
        padding: 12px 25px;
    }
}

/* Responsive cho mobile lớn (phablet) */
@media (min-width: 376px) and (max-width: 480px) {
    body {
        padding: 12px;
    }

    .container {
        padding: 18px;
    }

    header {
        margin-bottom: 20px;
        padding-bottom: 12px;
        border-bottom: 4px solid #667eea;
    }

    header h1 {
        font-size: 20px;
        font-weight: 800;
        letter-spacing: 0.8px;
    }

    .step {
        padding: 16px;
        margin-bottom: 20px;
    }

    .step-header {
        margin-bottom: 12px;
        gap: 10px;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .step h2 {
        font-size: 16px;
    }

    .step-content p {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .api-code-box {
        padding: 10px;
        margin: 12px 0;
    }

    .api-code-content {
        padding: 8px;
    }

    .api-code-content code {
        font-size: 11px;
    }

    .copy-btn {
        padding: 12px 18px;
        font-size: 14px;
        min-height: 44px;
    }

    .video-container {
        margin-top: 15px;
    }

    .warning-note,
    .important-note,
    .success-note {
        padding: 10px;
        margin: 12px 0;
    }

    .warning-note strong,
    .important-note p,
    .success-note p {
        font-size: 13px;
    }

    .important-note ul {
        margin-left: 16px;
        font-size: 13px;
    }
}

/* Responsive cho mobile nhỏ */
@media (max-width: 375px) {
    body {
        padding: 8px;
    }

    .container {
        padding: 15px;
        border-radius: 10px;
    }

    header {
        margin-bottom: 18px;
        padding-bottom: 12px;
        border-bottom: 3px solid #667eea;
    }

    header h1 {
        font-size: 18px;
        font-weight: 800;
        letter-spacing: 0.6px;
        line-height: 1.3;
    }

    .step {
        padding: 14px;
        margin-bottom: 18px;
        border-radius: 8px;
    }

    .step-header {
        margin-bottom: 12px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .step-number {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }

    .step h2 {
        font-size: 15px;
        line-height: 1.3;
    }

    .step-content {
        padding-left: 0;
    }

    .step-content p {
        font-size: 13px;
        margin-bottom: 10px;
        line-height: 1.5;
    }

    .api-code-box {
        padding: 10px;
        margin: 10px 0;
    }

    .api-code-content {
        padding: 8px;
    }

    .api-code-content code {
        font-size: 10px;
        line-height: 1.4;
    }

    .copy-btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
        border-radius: 6px;
    }

    .copy-notification {
        padding: 10px 16px;
        font-size: 13px;
    }

    .video-container {
        margin-top: 12px;
        border-radius: 6px;
    }

    .warning-note,
    .important-note,
    .success-note {
        padding: 10px;
        margin: 10px 0;
    }

    .warning-note strong {
        font-size: 13px;
        line-height: 1.4;
    }

    .important-note p {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .important-note ul {
        margin-left: 16px;
        font-size: 12px;
    }

    .important-note li {
        margin-bottom: 6px;
    }

    .success-note p {
        font-size: 13px;
    }
}

/* Tối ưu cho landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 8px;
    }

    .container {
        padding: 15px;
    }

    header {
        margin-bottom: 15px;
        padding-bottom: 12px;
        border-bottom: 3px solid #667eea;
    }

    header h1 {
        font-size: 19px;
        font-weight: 800;
        letter-spacing: 0.7px;
    }

    .step {
        padding: 12px;
        margin-bottom: 15px;
    }

    .step-header {
        margin-bottom: 10px;
    }

    .step-content p {
        margin-bottom: 8px;
        font-size: 13px;
    }

    .video-container {
        margin-top: 10px;
    }
}

/* Tối ưu scroll mượt cho mobile */
@media (max-width: 768px) {
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    body {
        overflow-x: hidden;
    }
}
