/* ========== GLOBAL STYLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* ========== CONTAINER SHARED ========== */
.bao-hanh-container,
.tra-cuu-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ========== PAGE HEADER SHARED ========== */
.page-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.page-header h1 {
    color: #2c3e50;
    font-size: 32px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.page-header p {
    color: #7f8c8d;
    font-size: 16px;
    line-height: 1.6;
}

.page-header .highlight {
    color: #e74c3c;
    font-weight: bold;
}

/* ========== QR SECTION SHARED ========== */
.scan-qr-code,
.scan-qr-section {
    width: 100%;
    max-width: 800px;
    margin: 24px auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    text-align: center;
    gap: 80px;
}

.qr-product-image {
    width: 360px;
    margin-bottom: 22px;
}

.qr-product-content {
    width: 120px;
    border-radius: 7px;
    border: 2px solid #aaa;
    padding: 2px;
    margin-bottom: 12px;
    background-color: #fff;
    margin-top: 43px;
}

.motainfo {
    color: #222;
    font-weight: 400;
    font-size: 16px;
    text-transform: uppercase;
}

.scan-qr-code1 {
    margin-top: -40px;
    margin-bottom: 20px;
}

/* ========== FORM STYLES (KÍCH HOẠT PAGE) ========== */
.instruction-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #3498db;
}

.instruction-section h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 15px;
}

.instruction-section .note {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 12px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 14px;
    color: #856404;
}

.instruction-section .note strong {
    display: block;
    margin-bottom: 5px;
}

.form-section {
    margin-bottom: 30px;
}

.section-title {
    background: #34495e;
    color: white;
    padding: 12px 20px;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    border-radius: 4px;
}

.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 14px;
}

.form-row label .required {
    color: #e74c3c;
    margin-left: 3px;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row input[type="number"],
.form-row input[type="date"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    transition: border-color 0.3s;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-row textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 13px;
}

/* ========== INPUT WITH QR BUTTON ========== */
.input-with-qr,
.search-input-wrapper {
    position: relative;
    display: flex;
    gap: 0;
    align-items: stretch;
}

.input-with-qr input {
    flex: 1;
    border-radius: 4px 0 0 4px;
    border-right: none;
}

.search-input-wrapper {
    margin-bottom: 15px;
}

.search-input-wrapper input {
    flex: 1;
    padding: 18px 20px;
    border: 2px solid #3498db;
    border-radius: 8px 0 0 8px;
    border-right: none;
    font-size: 16px;
    font-family: Arial, sans-serif;
    transition: all 0.3s;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* QR BUTTONS */
.qr-icon-btn {
    background: white;
    border: 1px solid #ddd;
    border-left: none;
    border-radius: 0 4px 4px 0;
    padding: 0 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    min-width: 50px;
}

.qr-icon-btn:hover {
    background: #f8f9fa;
}

.qr-icon-btn svg {
    width: 24px;
    height: 24px;
    fill: #3498db;
}

.qr-scan-btn {
    background: #3498db;
    border: 2px solid #3498db;
    border-left: none;
    border-radius: 0 8px 8px 0;
    padding: 0 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    min-width: 70px;
}

.qr-scan-btn:hover {
    background: #2980b9;
    border-color: #2980b9;
}

.qr-scan-btn svg {
    width: 30px;
    height: 30px;
    fill: white;
}

/* ========== SCANNER MODAL ========== */
#scannerModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#scannerModal.active {
    display: flex;
}

#qrPreview {
    width: 100%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

#scannerModal h3 {
    color: white;
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

#scannerModal p {
    color: #ccc;
    margin-bottom: 15px;
    text-align: center;
}

#closeScanner {
    margin-top: 20px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
}

#closeScanner:hover {
    background: #c0392b;
}

.scan-status {
    color: #fff;
    background: rgba(52, 152, 219, 0.9);
    padding: 10px 20px;
    border-radius: 5px;
    margin-top: 10px;
    font-size: 14px;
    max-width: 500px;
    text-align: center;
}

.scan-status.success {
    background: rgba(39, 174, 96, 0.9);
}

.scan-status.checking {
    background: rgba(241, 196, 15, 0.9);
}

.scan-status.error {
    background: rgba(231, 76, 60, 0.9);
}

/* ========== BUTTONS ========== */
.submit-section {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 50px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-submit.btn-logout {
    background: #95a5a6;
}

.btn-submit.btn-logout:hover {
    background: #7f8c8d;
}

.search-btn {
    width: 100%;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    padding: 18px 50px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.6);
}

/* ========== MODALS SHARED ========== */
#alreadyActivatedModal,
#errorModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

#alreadyActivatedModal.active,
#errorModal.active {
    display: flex;
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ACTIVATED MODAL */
.activated-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    width: 60%;
    text-align: center;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.activated-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: #f39c12;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
}

.activated-icon.expired {
    background: #e74c3c;
}

.activated-icon.active {
    background: #27ae60;
}

.activated-content h2 {
    color: #e67e22;
    font-size: 18px;
    margin-bottom: 15px;
}

.activated-content h2.expired {
    color: #e74c3c;
}

.activated-content h2.active {
    color: #27ae60;
}

.activated-info {
    height: 250px;
    overflow-y: auto;
    background: #fff3cd;
    border: 2px solid #f39c12;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: left;
}

.activated-info.expired {
    background: #fee;
    border-color: #e74c3c;
}

.activated-info.active {
    background: #d4edda;
    border-color: #27ae60;
}

.activated-info p {
    margin: 10px 0;
    line-height: 1.8;
    color: #856404;
}

.activated-info.expired p {
    color: #c0392b;
}

.activated-info.active p {
    color: #155724;
}

.activated-info strong {
    color: #2c3e50;
    display: inline-block;
}

.warranty-status {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: bold;
    font-size: 16px;
}

.warranty-status.active {
    background: #d4edda;
    color: #155724;
    border: 2px solid #27ae60;
}

.warranty-status.expired {
    background: #fee;
    color: #c0392b;
    border: 2px solid #e74c3c;
}

.close-activated-btn {
    background: #3498db;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
}

.close-activated-btn:hover {
    background: #2980b9;
}

/* ERROR MODAL */
.error-modal-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    position: relative;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.error-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: #e74c3c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: white;
}

.error-modal-content h3 {
    color: #e74c3c;
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
}

.error-modal-body {
    text-align: center;
    margin: 20px 0;
}

.error-modal-body p {
    margin: 10px 0;
    line-height: 1.8;
}

.close-error-btn {
    background: #3498db;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
}

.close-error-btn:hover {
    background: #2980b9;
}

/* MODAL CLOSE BUTTONS */
.modal-close-x,
.error-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

.error-modal-close {
    background: #e74c3c;
}

.modal-close-x:hover {
    background: #7f8c8d;
    transform: rotate(90deg);
}

.error-modal-close:hover {
    background: #c0392b;
    transform: rotate(90deg);
}

/* SUCCESS MODAL */
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.success-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    animation: slideIn 0.3s ease-out;
    position: relative;
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: #27ae60;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: white;
}

.success-content h2 {
    color: #27ae60;
    font-size: 28px;
    margin-bottom: 15px;
}

.success-content .brand-highlight {
    color: #e74c3c;
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: bold;
}

.success-info {
    height: 200px;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: left;
}

.success-info p {
    margin: 10px 0;
    line-height: 1.8;
}

.success-info strong {
    color: #2c3e50;
    display: inline-block;
    min-width: 150px;
}

.close-modal {
    background: #3498db;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
}

/* ERROR NOTICE */
.error-notice {
    background: #fee;
    border-left: 4px solid #e74c3c;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: #c0392b;
}

.error-notice p {
    margin: 5px 0;
    line-height: 1.6;
}

/* ========== TRA CỨU PAGE SPECIFIC ========== */
.search-section {
    margin: 30px 0;
}

.search-box {
    max-width: 700px;
    margin: 0 auto;
}

.search-label {
    display: block;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 18px;
    text-align: center;
}

.search-hint {
    text-align: center;
    color: #7f8c8d;
    font-size: 14px;
    margin-top: 10px;
}

.results-section {
    margin-top: 40px;
    display: none;
}

.results-header {
    background: #3498db;
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    font-size: 18px;
    font-weight: bold;
}

.warranty-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-top: none;
    padding: 25px;
    margin-bottom: 20px;
    position: relative;
}

.warranty-card:last-child {
    border-radius: 0 0 8px 8px;
}

.warranty-status-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 13px;
}

.warranty-status-badge.active {
    background: #d4edda;
    color: #155724;
    border: 2px solid #27ae60;
}

.warranty-status-badge.expired {
    background: #fee;
    color: #c0392b;
    border: 2px solid #e74c3c;
}

.warranty-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.warranty-info-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.warranty-info-item strong {
    display: block;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 13px;
}

.warranty-info-item span {
    color: #555;
    font-size: 15px;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    margin-top: 30px;
}

.no-results h3 {
    color: #856404;
    font-size: 24px;
    margin-bottom: 15px;
}

.no-results p {
    color: #856404;
    font-size: 16px;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #3498db;
}

/* ========== RESPONSIVE ========== */
@media only screen and (max-width: 900px) {
    .activated-content {
        width: 90% !important;
        padding: 40px;
    }
}

@media (max-width: 760px) {

    .scan-qr-code,
    .scan-qr-section {
        flex-direction: column;
        align-items: center;
        gap: 0px;
    }

    .warranty-info {
        grid-template-columns: 1fr;
    }

    .warranty-status-badge {
        position: static;
        display: inline-block;
        margin-bottom: 15px;
    }

    .search-input-wrapper input {
        font-size: 14px;
        padding: 15px;
    }

    .qr-scan-btn {
        min-width: 60px;
    }
}

@media (max-width: 768px) {
    .qr-product-content {
        width: 210px;
    }

    .qr-product-content img {
        width: 100%;
    }

    .bao-hanh-container,
    .tra-cuu-container {
        margin: 20px 10px;
        padding: 15px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .btn-submit {
        padding: 12px 30px;
        font-size: 14px;
    }

    .success-content,
    .activated-content {
        padding: 25px;
    }

    #qrPreview {
        max-width: 90%;
    }
}