/**
 * NEXOR Warranty - Frontend CSS v7.2.7
 */

/* ========== CSS Custom Properties ========== */
:root {
    --nexor-dark: #000000;
    --nexor-dark-card: #111111;
    --nexor-dark-input: #1a1a1a;
    --nexor-dark-border: #2a2a2a;
    --nexor-dark-hover: #222222;
    --nexor-green: #4caf50;
    --nexor-red: #ef5350;
    --nexor-orange: #ffa726;
    --nexor-blue: #42a5f5;
    --nexor-text: #ffffff;
    --nexor-text-secondary: #aaaaaa;
    --nexor-text-muted: #777777;
    --nexor-accent: #e0e0e0;
    --nexor-radius-sm: 6px;
    --nexor-radius-md: 10px;
    --nexor-radius-lg: 14px;
    --nexor-transition: 0.25s ease;
    --nexor-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ========== Container - Full-width dark wrapper + centered inner content ========== */

/* Outer wrapper: breaks out of theme container padding to fill full width with black background */
.nexor-warranty-app {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background: #000;
    font-family: var(--nexor-font);
    color: var(--nexor-text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Inner content: centered, max 520px */
.nexor-warranty-app > .nexor-tabs,
.nexor-warranty-app > .nexor-tab-content,
.nexor-warranty-app > .nexor-lookup,
.nexor-warranty-app > .nexor-claim,
.nexor-warranty-app > .nexor-loading,
.nexor-warranty-app > .nexor-result {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

.nexor-warranty-app > .nexor-loading {
    padding-top: 60px;
    padding-bottom: 60px;
}

.nexor-warranty-app > .nexor-tabs {
    padding-top: 32px;
    padding-left: 20px;
    padding-right: 20px;
}

.nexor-warranty-app > .nexor-tab-content {
    padding-bottom: 40px;
}

/* All child elements must respect box-sizing */
.nexor-warranty-app *,
.nexor-warranty-app *::before,
.nexor-warranty-app *::after {
    box-sizing: border-box;
}

/* ========== Tabs ========== */
.nexor-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--nexor-dark-border);
    margin-bottom: 28px;
}

.nexor-tab {
    flex: 1;
    text-align: center;
    padding: 14px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--nexor-text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color var(--nexor-transition), border-color var(--nexor-transition);
    user-select: none;
    letter-spacing: 0.3px;
}

.nexor-tab:hover {
    color: var(--nexor-text-secondary);
}

.nexor-tab.active {
    color: var(--nexor-text);
    border-bottom-color: var(--nexor-text);
    font-weight: 600;
}

.nexor-tab-content {
    display: none;
    animation: nexor-fade-in 0.3s ease;
}

.nexor-tab-content.active {
    display: block;
}

@keyframes nexor-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== Lookup Section ========== */
.nexor-lookup {
    text-align: center;
}

.nexor-lookup h2 {
    font-size: 20px;
    margin-bottom: 6px;
    color: var(--nexor-text);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nexor-lookup p {
    color: var(--nexor-text-muted);
    margin-bottom: 24px;
    font-size: 13px;
}

.nexor-lookup-input {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 460px;
    margin: 0 auto 16px;
}

.nexor-lookup-input input {
    flex: 1;
    padding: 13px 16px;
    border: 1px solid var(--nexor-dark-border);
    border-radius: var(--nexor-radius-md);
    font-size: 15px;
    font-family: var(--nexor-font);
    transition: border-color var(--nexor-transition), box-shadow var(--nexor-transition);
    background: var(--nexor-dark-input);
    color: var(--nexor-text);
}

.nexor-lookup-input input::placeholder {
    color: var(--nexor-text-muted);
}

.nexor-lookup-input input:focus {
    outline: none;
    border-color: #555;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.nexor-lookup-input button {
    padding: 13px 28px;
    background: var(--nexor-text);
    color: var(--nexor-dark);
    border: none;
    border-radius: var(--nexor-radius-md);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--nexor-font);
    cursor: pointer;
    transition: background var(--nexor-transition), transform var(--nexor-transition), box-shadow var(--nexor-transition);
    letter-spacing: 0.3px;
}

.nexor-lookup-input button:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.nexor-lookup-input button:active {
    transform: translateY(0);
    box-shadow: none;
}

.nexor-lookup-input button:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========== Result Card ========== */
.nexor-result {
    margin-top: 24px;
    border: 1px solid var(--nexor-dark-border);
    border-radius: var(--nexor-radius-lg);
    overflow: hidden;
    text-align: left;
    background: var(--nexor-dark-card);
}

.nexor-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #1a1a1a;
    border-bottom: 1px solid var(--nexor-dark-border);
}

.nexor-result-header .model {
    font-size: 17px;
    font-weight: 700;
    color: var(--nexor-text);
}

.nexor-result-header .status {
    padding: 4px 14px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nexor-result-header .status-active {
    background: rgba(76, 175, 80, 0.2);
    color: var(--nexor-green);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.nexor-result-header .status-expired {
    background: rgba(239, 83, 80, 0.2);
    color: var(--nexor-red);
    border: 1px solid rgba(239, 83, 80, 0.3);
}

.nexor-result-header .status-claimed {
    background: rgba(255, 167, 38, 0.2);
    color: var(--nexor-orange);
    border: 1px solid rgba(255, 167, 38, 0.3);
}

.nexor-result-header .status-cancelled {
    background: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
    border: 1px solid rgba(158, 158, 158, 0.3);
}

.nexor-result-header .status-inactive {
    background: rgba(66, 165, 245, 0.2);
    color: var(--nexor-blue);
    border: 1px solid rgba(66, 165, 245, 0.3);
}

.nexor-result-header .status-pending {
    background: rgba(66, 165, 245, 0.2);
    color: var(--nexor-blue);
    border: 1px solid rgba(66, 165, 245, 0.3);
}

.nexor-result-body {
    padding: 20px;
}

.nexor-result-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--nexor-dark-border);
    font-size: 14px;
}

.nexor-result-row:last-child {
    border-bottom: none;
}

.nexor-result-row .label {
    color: var(--nexor-text-muted);
}

.nexor-result-row .value {
    font-weight: 600;
    color: var(--nexor-text);
    text-align: right;
}

.nexor-result-row .value.mono {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    color: var(--nexor-accent);
}

/* ========== Codes Section ========== */
.nexor-codes {
    display: flex;
    gap: 24px;
    margin-top: 0;
    padding: 20px;
    border-top: 1px solid var(--nexor-dark-border);
    justify-content: center;
    flex-wrap: wrap;
    background: var(--nexor-dark-card);
}

.nexor-code-block {
    text-align: center;
    padding: 14px;
    border-radius: var(--nexor-radius-md);
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nexor-code-block svg {
    display: block;
}

.nexor-code-block .code-label {
    font-size: 11px;
    color: #666;
    margin-top: 6px;
    letter-spacing: 0.3px;
}

/* ========== Activate Section (dark theme override for inline styles) ========== */
.nexor-activate-section,
.nexor-result .nexor-activate-section {
    background: rgba(66, 165, 245, 0.08) !important;
    border-radius: 12px !important;
    padding: 20px !important;
    margin-top: 12px !important;
    border: 1px solid rgba(66, 165, 245, 0.2) !important;
}

.nexor-activate-section h4 {
    color: var(--nexor-blue) !important;
}

.nexor-activate-section p {
    color: var(--nexor-text-secondary) !important;
}

.nexor-activate-section input[type="date"] {
    background: var(--nexor-dark-input) !important;
    color: var(--nexor-text) !important;
    border: 1px solid var(--nexor-dark-border) !important;
    border-radius: 10px !important;
    color-scheme: dark;
}

.nexor-activate-section input[type="date"]:focus {
    border-color: var(--nexor-blue) !important;
    box-shadow: 0 0 0 3px rgba(66, 165, 245, 0.15) !important;
}

.nexor-activate-section button {
    background: linear-gradient(135deg, #1565c0, #1976d2) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

.nexor-activate-section button:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.4) !important;
}

.nexor-activate-section button:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ========== Claim Section ========== */
.nexor-claim {
    max-width: 460px;
    margin: 0 auto;
}

.nexor-claim h2 {
    font-size: 20px;
    margin-bottom: 6px;
    color: var(--nexor-text);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nexor-claim p {
    color: var(--nexor-text-muted);
    margin-bottom: 24px;
    font-size: 13px;
}

.nexor-claim .form-group {
    margin-bottom: 18px;
}

.nexor-claim label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--nexor-text-secondary);
    margin-bottom: 6px;
}

.nexor-claim input,
.nexor-claim textarea,
.nexor-claim select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--nexor-dark-border);
    border-radius: var(--nexor-radius-sm);
    font-size: 14px;
    font-family: var(--nexor-font);
    transition: border-color var(--nexor-transition), box-shadow var(--nexor-transition);
    box-sizing: border-box;
    background: var(--nexor-dark-input);
    color: var(--nexor-text);
}

.nexor-claim input::placeholder,
.nexor-claim textarea::placeholder {
    color: var(--nexor-text-muted);
}

.nexor-claim select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.nexor-claim input:focus,
.nexor-claim textarea:focus,
.nexor-claim select:focus {
    outline: none;
    border-color: #555;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.nexor-claim textarea {
    resize: vertical;
    min-height: 80px;
}

.nexor-claim button {
    width: 100%;
    padding: 14px;
    background: var(--nexor-text);
    color: var(--nexor-dark);
    border: none;
    border-radius: var(--nexor-radius-md);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--nexor-font);
    cursor: pointer;
    transition: background var(--nexor-transition), transform var(--nexor-transition), box-shadow var(--nexor-transition);
    letter-spacing: 0.3px;
}

.nexor-claim button:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.nexor-claim button:active {
    transform: translateY(0);
    box-shadow: none;
}

.nexor-claim button:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========== Messages ========== */
.nexor-message {
    padding: 12px 16px;
    border-radius: var(--nexor-radius-md);
    margin-top: 16px;
    font-size: 14px;
}

.nexor-message-success {
    background: rgba(76, 175, 80, 0.12);
    color: var(--nexor-green);
    border: 1px solid rgba(76, 175, 80, 0.25);
}

.nexor-message-error {
    background: rgba(239, 83, 80, 0.12);
    color: var(--nexor-red);
    border: 1px solid rgba(239, 83, 80, 0.25);
}

.nexor-message-info {
    background: rgba(66, 165, 245, 0.12);
    color: var(--nexor-blue);
    border: 1px solid rgba(66, 165, 245, 0.25);
}

/* ========== Claims List ========== */
.nexor-claims-list {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--nexor-dark-border);
}

.nexor-claims-list h4 {
    font-size: 14px;
    color: var(--nexor-text-secondary);
    margin-bottom: 10px;
}

.nexor-claim-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--nexor-dark-hover);
    border-radius: var(--nexor-radius-sm);
    margin-bottom: 6px;
    font-size: 13px;
}

.nexor-claim-item:hover {
    background: #2a2a2a;
}

.nexor-claim-item .claim-code {
    font-family: monospace;
    font-weight: 600;
    color: var(--nexor-accent);
}

.nexor-claim-item .claim-status {
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.claim-status-pending { background: rgba(255, 167, 38, 0.15); color: var(--nexor-orange); }
.claim-status-reviewing { background: rgba(66, 165, 245, 0.15); color: var(--nexor-blue); }
.claim-status-approved { background: rgba(76, 175, 80, 0.15); color: var(--nexor-green); }
.claim-status-rejected { background: rgba(239, 83, 80, 0.15); color: var(--nexor-red); }
.claim-status-resolved { background: rgba(0, 150, 136, 0.15); color: #4db6ac; }

/* ========== Spinner ========== */
@keyframes nexor-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.nexor-spinner {
    border-color: #333 !important;
    border-top-color: #fff !important;
}

.nexor-loading p {
    color: var(--nexor-text-muted) !important;
}

/* ========== Country Select Frontend ========== */
.nexor-fw-country-wrap {
    position: relative;
}

.nexor-fw-country-search {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--nexor-dark-border);
    border-radius: var(--nexor-radius-sm) var(--nexor-radius-sm) 0 0;
    font-size: 14px;
    font-family: var(--nexor-font);
    box-sizing: border-box;
    border-bottom: none;
    background: var(--nexor-dark-input);
    color: var(--nexor-text);
    transition: border-color var(--nexor-transition), box-shadow var(--nexor-transition);
}

.nexor-fw-country-search::placeholder {
    color: var(--nexor-text-muted);
}

.nexor-fw-country-search:focus {
    outline: none;
    border-color: #555;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.nexor-fw-country-select {
    width: 100%;
    max-height: 160px;
    padding: 6px 10px;
    border: 1px solid var(--nexor-dark-border);
    border-radius: 0 0 var(--nexor-radius-sm) var(--nexor-radius-sm);
    font-size: 13px;
    font-family: var(--nexor-font);
    background: var(--nexor-dark-input);
    color: var(--nexor-text);
}

/* ========== Print Styles (keep white bg for printing) ========== */
@media print {
    .nexor-tabs,
    .nexor-lookup-input,
    .nexor-claim button,
    .nexor-message {
        display: none !important;
    }

    .nexor-result {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
        background: #fff;
        color: #333;
    }

    .nexor-result-row .label { color: #666; }
    .nexor-result-row .value { color: #333; }

    .nexor-code-block {
        box-shadow: none;
    }
}

/* ========== Mobile Responsive ========== */
@media (max-width: 600px) {
    .nexor-warranty-app > .nexor-tabs,
    .nexor-warranty-app > .nexor-tab-content,
    .nexor-warranty-app > .nexor-lookup,
    .nexor-warranty-app > .nexor-claim,
    .nexor-warranty-app > .nexor-loading,
    .nexor-warranty-app > .nexor-result {
        padding-left: 16px;
        padding-right: 16px;
    }

    .nexor-warranty-app > .nexor-tabs {
        padding-top: 20px;
    }

    .nexor-lookup-input {
        flex-direction: column;
    }

    .nexor-lookup-input input {
        width: 100%;
    }

    .nexor-lookup-input button {
        width: 100%;
    }

    .nexor-codes {
        flex-direction: column;
        align-items: center;
        gap: 16px;
        padding: 16px;
    }

    .nexor-result-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 14px 16px;
    }

    .nexor-result-body {
        padding: 16px;
    }

    .nexor-result-row {
        flex-direction: column;
        gap: 2px;
        padding: 8px 0;
    }

    .nexor-result-row .value {
        text-align: left;
    }

    .nexor-tab {
        padding: 12px 14px;
        font-size: 13px;
    }

    .nexor-claim {
        max-width: 100%;
    }

    .nexor-claim-item {
        flex-wrap: wrap;
        gap: 4px;
    }

    .nexor-activate-section > div[style*="display:flex"] {
        flex-direction: column !important;
    }

    .nexor-activate-section input[type="date"],
    .nexor-activate-section button {
        width: 100% !important;
        min-width: unset !important;
    }
}

@media (max-width: 400px) {
    .nexor-warranty-app > .nexor-tabs,
    .nexor-warranty-app > .nexor-tab-content,
    .nexor-warranty-app > .nexor-lookup,
    .nexor-warranty-app > .nexor-claim,
    .nexor-warranty-app > .nexor-loading,
    .nexor-warranty-app > .nexor-result {
        padding-left: 12px;
        padding-right: 12px;
    }

    .nexor-lookup h2,
    .nexor-claim h2 {
        font-size: 18px;
    }

    .nexor-result-header .model {
        font-size: 15px;
    }

    .nexor-lookup-input input {
        padding: 11px 12px;
        font-size: 14px;
    }

    .nexor-lookup-input button {
        padding: 11px 16px;
        font-size: 14px;
    }
}
