/**
 * Think Ink Printer Comparison - Frontend Styles
 */

/* Variables */
:root {
    --tipc-primary: #ff0000;
    --tipc-primary-dark: #cc0000;
    --tipc-gray: #858585;
    --tipc-gray-light: #f5f5f5;
    --tipc-text: #333;
    --tipc-border: #ddd;
    --tipc-white: #fff;
	--tipc-gray-evenstripe: #959595;
}

/* Wrapper */
.tipc-comparison-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--tipc-text);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

/* Steps */
.tipc-step {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 7px dotted var(--tipc-border);
}

.tipc-step:last-of-type {
    border-bottom: none;
}

.tipc-step-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: var(--tipc-text);
}

.tipc-step-number {
    display: inline-block;
    font-weight: 700;
    margin-right: 15px;
    color: var(--tipc-primary);
}

/* Input Groups */
.tipc-input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.tipc-input-group {
    display: flex;
    flex-direction: column;
	align-items: flex-start;
	justify-content: left;
	gap: 10px;
}

.tipc-input-group label {
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--tipc-text);
}

.tipc-input {
    padding: 10px 15px;
    font-size: 14px;
    border: 1px solid var(--tipc-border);
    border-radius: 4px;
    background: var(--tipc-white);
    min-width: 150px;
}

.tipc-input:focus {
    outline: none;
    border-color: var(--tipc-primary);
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.1);
}

/* Buttons */
.tipc-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.tipc-btn-add,
.tipc-btn-submit {
    background: var(--tipc-primary);
    color: var(--tipc-white);
}

.tipc-btn-add:hover,
.tipc-btn-submit:hover {
    background: var(--tipc-primary-dark);
}

.tipc-btn-secondary {
    background: var(--tipc-gray-light);
    color: var(--tipc-text);
    border: 1px solid var(--tipc-border);
}

.tipc-btn-secondary:hover {
    background: var(--tipc-border);
}

/* Printer Selection */
.tipc-printer-selection {
    margin-bottom: 20px;
}

.tipc-printer-select-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.tipc-printer-select {
    padding: 10px 15px;
    font-size: 14px;
    border: 1px solid var(--tipc-border);
    border-radius: 4px;
    background: var(--tipc-white);
    min-width: 300px;
}

/* Selected Printers Tags */
.tipc-selected-printers {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tipc-printer-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--tipc-gray-light);
    border: 1px solid var(--tipc-border);
    border-radius: 4px;
    font-size: 13px;
}

.tipc-printer-tag .tipc-tag-name {
    margin-right: 10px;
}

.tipc-printer-tag .tipc-tag-remove {
    background: none;
    border: none;
    color: var(--tipc-primary);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    font-weight: bold;
}

.tipc-printer-tag .tipc-tag-remove:hover {
    color: var(--tipc-primary-dark);
}

/* Custom Printer Form */
.tipc-custom-printer {
    background: var(--tipc-gray-light);
    padding: 20px;
    border-radius: 4px;
    margin-top: 20px;
}

.tipc-custom-printer h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
}

.tipc-custom-fields .tipc-field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.tipc-custom-fields .tipc-field-row:last-child {
    margin-bottom: 0;
}

.tipc-custom-fields .tipc-input-group {
    flex: 1;
    min-width: 200px;
}

.tipc-custom-fields .tipc-input {
    width: 100%;
}

/* Email Capture */
.tipc-email-capture {
    background: var(--tipc-gray-light);
    padding: 20px;
    border-radius: 4px;
}

.tipc-email-note {
    margin: 10px 0 0 0;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.tipc-welcome-back {
    background: #e8f5e9;
    padding: 15px 20px;
    border-radius: 4px;
    border-left: 4px solid #4caf50;
}

.tipc-welcome-back p {
    margin: 0;
    color: #2e7d32;
    font-weight: 500;
}

/* Results Table */
.tipc-results {
    margin-top: 30px;
}

.tipc-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

.tipc-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tipc-comparison-table th,
.tipc-comparison-table td {
    padding: 7px 7px;
    text-align: center;
    border: 1px solid var(--tipc-border);
}

.tipc-comparison-table thead th {
    background: var(--tipc-primary);
    color: var(--tipc-white);
    font-weight: 600;
}

.tipc-comparison-table .tipc-period-header,
.tipc-comparison-table .tipc-row-label {
    background: var(--tipc-white);
    color: var(--tipc-text);
    font-weight: 600;
    text-align: left;
}

.tipc-comparison-table .tipc-printer-header {
    min-width: 120px;
}

.tipc-comparison-table .tipc-printer-header .tipc-remove-printer {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    margin-top: 5px;
}

.tipc-comparison-table .tipc-printer-header .tipc-remove-printer:hover {
    color: var(--tipc-white);
    text-decoration: underline;
}

.tipc-comparison-table tbody td {
    background: var(--tipc-gray);
    /* color: var(--tipc-white);  ------------------------------------------------------------------------------------------------ */
    color: black;
    font-weight: 600;
    min-width: 130px;
}

.tipc-comparison-table tbody th {
    background: var(--tipc-primary);
    color: var(--tipc-white);
    font-weight: 600;
    text-align: left;
}

/* Period grouping rows */
.tipc-period-group {
    border-top: 2px solid var(--tipc-text);
}

.tipc-row-cartridges td,
.tipc-row-printer td,
.tipc-row-total td {
    background: var(--tipc-gray);
}

/* Locked/Unlocked states */
.tipc-row-printer.tipc-locked td,
.tipc-row-total.tipc-locked td {
    background: var(--tipc-gray-light);
    color: #999;
    position: relative;
}

.tipc-row-printer.tipc-locked .tipc-lock-message,
.tipc-row-total.tipc-locked .tipc-lock-message {
    font-size: 11px;
    display: block;
    color: #666;
}

/* Disclaimer */
.tipc-disclaimer {
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    font-size: 13px;
    color: #856404;
}

.tipc-disclaimer strong {
    color: var(--tipc-primary);
}

/* Empty State */
.tipc-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

/* Loading State */
.tipc-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive */
@media screen and (max-width: 768px) {

    .tipc-printer-select {
        width: 100%;
        min-width: auto;
    }

    .tipc-printer-select-row {
        flex-direction: column;
        align-items: stretch;
    }

    .tipc-btn {
        width: 100%;
        text-align: center;
    }

    .tipc-table-wrapper {
        margin: 0 -20px 20px;
        padding: 0 20px;
    }

    .tipc-comparison-table {
        font-size: 12px;
        /*min-width: 600px;*/
    }

    .tipc-comparison-table th,
    .tipc-comparison-table td {
        padding: 8px 5px;
        white-space: nowrap;
    }

    .tipc-custom-fields .tipc-input-group {
        min-width: 100%;
    }
}

/* Print Styles */
@media print {
    .tipc-step-1,
    .tipc-step-2,
    .tipc-step-3 {
        display: none !important;
    }

    .tipc-results {
        margin-top: 0;
    }

    .tipc-comparison-table thead th {
        background: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .tipc-comparison-table tbody td {
        background: #666 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Custom striping of price comparisons */
#tipc-results-body tr>td {
	/*background-color: var(--tipc-gray);
    border-top: unset;
	border-bottom: unset; */
    background-color: white;
    border: 1px solid var(--tipc-border);
}
#tipc-results-body tr:nth-child(even)>td {
	/* background-color: var(--tipc-gray-evenstripe); */
    background-color: white;
}
/* CUSTOM */
/* 'custom printer' button restyle */
button#tipc-toggle-custom {
    background-color: initial;
    border: none;
    color: var( --e-global-color-accent );
    font-style: italic;
	font-weight: 400;
    margin-left: auto;
	text-transform: none;
}
button#tipc-toggle-custom:hover {
    font-weight: 600;
}

/* hide header box until printers are selected */
#tipc-comparison-table:has(tbody>tr>td.tipc-empty-state) thead {
  display: none;
}
