/* ==========================================================================
   TDC Warranty — Public Styles
   ========================================================================== */

/* Form Wrapper */
.tdc-warranty-form-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
}

.tdc-warranty-form-wrap h2 {
    font-size: 28px;
    color: #1a3a5c;
    margin-bottom: 5px;
}

.tdc-warranty-form-subtitle {
    color: #666;
    margin-bottom: 25px;
}

/* Error Messages */
.tdc-warranty-errors {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-left: 4px solid #dc2626;
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.tdc-warranty-errors strong {
    color: #dc2626;
}

.tdc-warranty-errors ul {
    margin: 8px 0 0 20px;
    color: #991b1b;
}

.tdc-warranty-error {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.tdc-warranty-error h2 {
    color: #dc2626;
}

/* Fieldsets */
.tdc-warranty-fieldset {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px 25px;
    margin-bottom: 20px;
    background: #fafbfc;
}

.tdc-warranty-fieldset legend {
    font-size: 16px;
    font-weight: 600;
    color: #1a3a5c;
    padding: 0 10px;
}

/* Fields */
.tdc-warranty-field {
    margin-bottom: 16px;
}

.tdc-warranty-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: #374151;
    font-size: 14px;
}

.tdc-warranty-field .required {
    color: #dc2626;
}

.tdc-warranty-field input[type="text"],
.tdc-warranty-field input[type="email"],
.tdc-warranty-field input[type="tel"],
.tdc-warranty-field input[type="date"],
.tdc-warranty-field input[type="number"],
.tdc-warranty-field select,
.tdc-warranty-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s;
}

.tdc-warranty-field input:focus,
.tdc-warranty-field select:focus,
.tdc-warranty-field textarea:focus {
    border-color: #1a3a5c;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.1);
}

.tdc-warranty-field-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Tooltips */
.tdc-warranty-tooltip {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    background: #1a3a5c;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    cursor: help;
    margin-left: 6px;
    vertical-align: middle;
    user-select: none;
}

.tdc-warranty-tooltip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a3a5c;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
    width: 220px;
    text-align: left;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.tdc-warranty-tooltip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1a3a5c;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 101;
}

.tdc-warranty-tooltip:hover::after,
.tdc-warranty-tooltip:hover::before,
.tdc-warranty-tooltip:focus::after,
.tdc-warranty-tooltip:focus::before {
    opacity: 1;
    visibility: visible;
}

/* Field Row (multiple fields side by side) */
.tdc-warranty-field-row {
    display: flex;
    gap: 15px;
    margin-bottom: 16px;
}

.tdc-warranty-field-row .tdc-warranty-field {
    flex: 1;
    margin-bottom: 0;
}

/* Radio Group */
.tdc-warranty-radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.tdc-warranty-radio-group label {
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* Buttons */
.tdc-warranty-btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
    line-height: 1;
    box-sizing: border-box;
}

.tdc-warranty-btn-primary {
    background: #1a3a5c;
    color: #fff;
}

.tdc-warranty-btn-primary:hover {
    background: #264d73;
    color: #fff;
}

.tdc-warranty-btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.tdc-warranty-btn-secondary:hover {
    background: #d1d5db;
}

.tdc-warranty-form-submit {
    text-align: center;
    margin-top: 25px;
}

/* Success Page */
.tdc-warranty-success {
    text-align: center;
    padding: 30px;
    max-width: 600px;
    margin: 0 auto;
}

.tdc-warranty-success-icon {
    font-size: 48px;
    color: #16a34a;
    background: #dcfce7;
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
}

.tdc-warranty-success h2 {
    color: #16a34a;
    margin-bottom: 20px;
}

.tdc-warranty-success-details table {
    width: 100%;
    text-align: left;
    margin: 20px 0;
}

.tdc-warranty-success-details th {
    padding: 8px 12px;
    color: #6b7280;
    width: 40%;
}

.tdc-warranty-success-details td {
    padding: 8px 12px;
}

.tdc-warranty-success-actions {
    margin-top: 25px;
}

/* ==========================================================================
   Dashboard
   ========================================================================== */

.tdc-warranty-dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.tdc-warranty-dashboard h2 {
    color: #1a3a5c;
    margin-bottom: 20px;
}

/* Summary Cards */
.tdc-warranty-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.tdc-warranty-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.tdc-warranty-card-number {
    font-size: 36px;
    font-weight: 700;
    color: #1a3a5c;
}

.tdc-warranty-card-label {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.tdc-warranty-card-warning {
    border-color: #f59e0b;
    background: #fffbeb;
}

.tdc-warranty-card-warning .tdc-warranty-card-number {
    color: #d97706;
}

/* Dashboard Actions */
.tdc-warranty-dashboard-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

/* Sections */
.tdc-warranty-section {
    margin-bottom: 40px;
}

.tdc-warranty-section h3 {
    font-size: 20px;
    color: #1a3a5c;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

/* Filters */
.tdc-warranty-filters {
    margin-bottom: 15px;
}

.tdc-warranty-filters form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.tdc-warranty-filters select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
}

.tdc-warranty-filters input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    min-width: 300px;
    flex: 1;
}

.tdc-warranty-filters input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
}

/* Tables */
.tdc-warranty-table-wrap {
    overflow-x: auto;
}

.tdc-warranty-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tdc-warranty-table thead th {
    background: #f3f4f6;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

/* Sortable column headers */
.tdc-warranty-sort-link {
    color: #374151;
    text-decoration: none;
    white-space: nowrap;
    font-weight: 600;
}

.tdc-warranty-sort-link:hover {
    color: #1a3a5c;
    text-decoration: none;
}

.tdc-warranty-sort-active {
    color: #1a3a5c;
}

.tdc-warranty-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    color: #4b5563;
}

.tdc-warranty-table tbody tr:hover {
    background: #f9fafb;
}

.tdc-warranty-empty {
    text-align: center;
    color: #9ca3af;
    padding: 30px !important;
}

.tdc-warranty-actions a {
    font-size: 13px;
    white-space: nowrap;
}

/* Badges */
.tdc-warranty-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tdc-warranty-badge-pending   { background: #e5e7eb; color: #6b7280; }
.tdc-warranty-badge-active    { background: #dcfce7; color: #16a34a; }
.tdc-warranty-badge-expired   { background: #fef2f2; color: #dc2626; }
.tdc-warranty-badge-void      { background: #374151; color: #fff; }

/* Claim status badges */
.tdc-warranty-badge-claim-submitted    { background: #dbeafe; color: #2563eb; }
.tdc-warranty-badge-claim-under_review { background: #fef3c7; color: #d97706; }
.tdc-warranty-badge-claim-approved     { background: #dcfce7; color: #16a34a; }
.tdc-warranty-badge-claim-denied       { background: #fef2f2; color: #dc2626; }
.tdc-warranty-badge-claim-in_progress  { background: #e0e7ff; color: #4f46e5; }
.tdc-warranty-badge-claim-resolved     { background: #d1fae5; color: #059669; }
.tdc-warranty-badge-claim-cancelled    { background: #e5e7eb; color: #6b7280; }

/* Priority badges */
.tdc-warranty-priority {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.tdc-warranty-priority-low      { background: #e5e7eb; color: #6b7280; }
.tdc-warranty-priority-medium   { background: #dbeafe; color: #2563eb; }
.tdc-warranty-priority-high     { background: #fed7aa; color: #ea580c; }
.tdc-warranty-priority-critical { background: #fecaca; color: #dc2626; }

/* Pagination */
.tdc-warranty-pagination {
    display: flex;
    gap: 5px;
    margin-top: 15px;
    justify-content: center;
}

.tdc-warranty-page-current {
    display: inline-block;
    padding: 6px 12px;
    background: #1a3a5c;
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
}

.tdc-warranty-page-link {
    display: inline-block;
    padding: 6px 12px;
    background: #fff;
    color: #1a3a5c;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
}

.tdc-warranty-page-link:hover {
    background: #f3f4f6;
}

.tdc-warranty-page-info {
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    color: #6b7280;
    margin-right: 10px;
}

/* Detail Views */
.tdc-warranty-detail {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.tdc-warranty-back-link {
    display: inline-block;
    margin-bottom: 15px;
    color: #1a3a5c;
    text-decoration: none;
    font-size: 14px;
}

.tdc-warranty-back-link:hover {
    text-decoration: underline;
}

.tdc-warranty-detail h2 {
    display: inline-block;
    margin-right: 10px;
}

.tdc-warranty-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.tdc-warranty-detail-grid > * {
    min-width: 0;
    overflow-x: auto;
}

.tdc-warranty-detail-section {
    background: #fafbfc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.tdc-warranty-detail-section h3 {
    font-size: 16px;
    color: #1a3a5c;
    margin-bottom: 12px;
}

.tdc-warranty-detail-table {
    width: 100%;
}

.tdc-warranty-detail-table th {
    text-align: left;
    padding: 6px 10px;
    color: #6b7280;
    font-weight: 500;
    width: 40%;
    font-size: 13px;
}

.tdc-warranty-detail-table td {
    padding: 6px 10px;
    font-size: 13px;
}

.tdc-warranty-meta {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
}

.tdc-warranty-photos {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tdc-warranty-photo-thumb {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* Claim Context (on claim form) */
.tdc-warranty-claim-context {
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

/* ==========================================================================
   Admin Dashboard (Frontend)
   ========================================================================== */

/* Admin Navigation Tabs */
.tdc-warranty-admin-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 25px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tdc-warranty-admin-nav::-webkit-scrollbar {
    display: none;
}

.tdc-warranty-admin-nav-tab {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

.tdc-warranty-admin-nav-tab:hover {
    color: #1a3a5c;
    text-decoration: none;
}

.tdc-warranty-admin-nav-tab.active {
    color: #1a3a5c;
    border-bottom-color: #1a3a5c;
}

/* Admin Dashboard wider max-width */
.tdc-warranty-admin-dashboard {
    max-width: 1200px;
}

/* Admin Notices */
.tdc-warranty-notice {
    padding: 12px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.tdc-warranty-notice-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.tdc-warranty-notice-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Responsive */
@media (max-width: 768px) {
    .tdc-warranty-field-row {
        flex-direction: column;
        gap: 0;
    }

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

    .tdc-warranty-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .tdc-warranty-filters form {
        flex-direction: column;
    }

    .tdc-warranty-dashboard-actions {
        flex-wrap: wrap;
    }

    .tdc-warranty-tooltip::after {
        width: 180px;
        left: auto;
        right: -10px;
        transform: none;
    }

    .tdc-warranty-tooltip::before {
        left: auto;
        right: 2px;
        transform: none;
    }
}

@media (max-width: 480px) {
    .tdc-warranty-cards {
        grid-template-columns: 1fr;
    }

    .tdc-warranty-admin-nav-tab {
        padding: 10px 14px;
        font-size: 13px;
    }
}
