/* ============================================
   Sales Tax Helper — Page-Specific Styles
   ============================================ */

.main-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.main-content .upload-section {
    max-width: 900px;
    margin: 0 auto;
}

/* ============================================
   Upload Dropzones
   ============================================ */
.st-dropzone {
    border: 2px dashed rgba(206, 186, 76, 0.3);
    border-radius: 10px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: rgba(13, 40, 73, 0.2);
    position: relative;
}

.st-dropzone:hover {
    border-color: rgba(206, 186, 76, 0.6);
    background: rgba(206, 186, 76, 0.04);
}

.st-dropzone.dragover {
    border-color: rgb(206, 186, 76);
    background: rgba(206, 186, 76, 0.08);
    box-shadow: 0 0 20px rgba(206, 186, 76, 0.1) inset;
}

.st-dropzone.has-file {
    border-color: rgba(76, 175, 80, 0.5);
    background: rgba(76, 175, 80, 0.04);
    border-style: solid;
    pointer-events: none;
    opacity: 0.5;
}

.st-dropzone-content {
    pointer-events: none;
}

.st-dropzone-icon {
    color: rgba(206, 186, 76, 0.5);
    margin-bottom: 0.6rem;
    transition: color 0.2s, transform 0.2s;
}

.st-dropzone:hover .st-dropzone-icon {
    color: rgba(206, 186, 76, 0.8);
    transform: translateY(-2px);
}

.st-dropzone.dragover .st-dropzone-icon {
    color: rgb(206, 186, 76);
    transform: translateY(-4px);
}

.st-dropzone-title {
    margin: 0 0 0.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #f2f2f2;
}

.st-dropzone-hint {
    margin: 0 0 0.5rem;
    font-size: 0.82rem;
    color: rgba(242, 242, 242, 0.45);
}

.st-dropzone-formats {
    margin: 0;
    font-size: 0.72rem;
    color: rgba(206, 186, 76, 0.4);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 600;
}

.st-dropzone-tip {
    margin: 0.5rem 0 0;
    font-size: 0.72rem;
    color: rgba(242, 242, 242, 0.3);
    font-style: italic;
}

/* File attached indicator */
.st-file-attached {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.6rem;
    padding: 0.6rem 0.85rem;
    background: rgba(76, 175, 80, 0.08);
    border: 1px solid rgba(76, 175, 80, 0.25);
    border-radius: 6px;
    animation: stFileSlideIn 0.2s ease-out;
}

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

.st-file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(76, 175, 80, 0.7);
    min-width: 0;
}

.st-file-name {
    color: #90EE90;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.st-file-remove {
    flex-shrink: 0;
    background: none;
    border: none;
    color: rgba(255, 107, 107, 0.6);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.st-file-remove:hover {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
}

/* ============================================
   Config Sections
   ============================================ */
.config-section {
    background-color: rgba(13, 40, 73, 0.6);
    border: 1px solid rgba(206, 186, 76, 0.3);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.config-section h3 {
    color: rgb(206, 186, 76);
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   Results Section
   ============================================ */
.results-section {
    background-color: rgba(13, 40, 73, 0.5);
    border: 1px solid rgba(76, 175, 80, 0.4);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.25rem;
}

.results-section h3 {
    color: #4CAF50;
    margin: 0 0 1rem;
    font-size: 1.1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(206, 186, 76, 0.12);
    border-radius: 6px;
    padding: 0.9rem 0.75rem;
    text-align: center;
}

.stat-item .stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: rgb(206, 186, 76);
    line-height: 1.2;
}

.stat-item .stat-label {
    font-size: 0.72rem;
    color: rgba(242, 242, 242, 0.5);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, rgb(206, 186, 76) 0%, rgb(186, 166, 56) 100%);
    color: rgb(13, 40, 73);
    text-decoration: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(206, 186, 76, 0.3);
}

.download-btn:hover {
    background: linear-gradient(135deg, rgb(226, 206, 96) 0%, rgb(206, 186, 76) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(206, 186, 76, 0.4);
}

.download-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    background-color: transparent;
    color: rgb(206, 186, 76);
    border: 2px solid rgba(206, 186, 76, 0.4);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    border-color: rgb(206, 186, 76);
    background-color: rgba(206, 186, 76, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(206, 186, 76, 0.15);
}

.secondary-btn:active {
    transform: translateY(0);
}

/* Error Section */
.error-section {
    background-color: rgba(255, 107, 107, 0.08);
    border: 1px solid rgba(255, 107, 107, 0.4);
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.error-section h3 {
    color: #ff6b6b;
    font-size: 1rem;
    margin: 0 0 0.5rem;
}

.error-section p {
    color: #ff9999;
    font-size: 0.9rem;
    margin: 0 0 0.75rem;
}

/* Info Section */
.info-section {
    background-color: rgba(13, 40, 73, 0.4);
    border: 1px solid rgba(206, 186, 76, 0.15);
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1.25rem;
}

.info-section h4 {
    color: rgb(206, 186, 76);
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
}

/* Optional badge + section hint */
.optional-badge {
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(242, 242, 242, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.st-section-hint {
    font-size: 0.8rem;
    color: rgba(242, 242, 242, 0.5);
    line-height: 1.45;
    margin: -0.5rem 0 0.75rem;
}

.st-section-hint strong {
    color: rgba(242, 242, 242, 0.7);
}

/* ============================================
   Period Picker
   ============================================ */
.period-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.period-year {
    flex-shrink: 0;
}

.period-year label {
    display: block;
    font-size: 0.72rem;
    color: rgba(242, 242, 242, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.3rem;
}

.period-year select {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(206, 186, 76, 0.3);
    border-radius: 5px;
    color: #f2f2f2;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.45rem 0.6rem;
    cursor: pointer;
    appearance: auto;
}

.period-year select:focus {
    outline: none;
    border-color: rgb(206, 186, 76);
}

.period-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    flex: 1;
}

.period-btn {
    padding: 0.4rem 0.7rem;
    background: rgba(13, 40, 73, 0.4);
    border: 1px solid rgba(206, 186, 76, 0.2);
    border-radius: 5px;
    color: rgba(242, 242, 242, 0.7);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.period-btn span {
    font-weight: 400;
    font-size: 0.72rem;
    color: rgba(242, 242, 242, 0.4);
    margin-left: 0.15rem;
}

.period-btn:hover {
    border-color: rgba(206, 186, 76, 0.5);
    color: #f2f2f2;
}

.period-btn.selected {
    border-color: rgb(206, 186, 76);
    background: rgba(206, 186, 76, 0.12);
    color: rgb(206, 186, 76);
}

.period-btn.selected span {
    color: rgba(206, 186, 76, 0.7);
}

/* Custom date inputs */
.period-custom {
    margin-top: 0.75rem;
    animation: stFileSlideIn 0.2s ease-out;
}

.period-date-inputs {
    display: flex;
    gap: 1rem;
}

.period-date-field {
    flex: 1;
    max-width: 200px;
}

.period-date-field label {
    display: block;
    font-size: 0.72rem;
    color: rgba(242, 242, 242, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.3rem;
}

.period-date-field input[type="date"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(206, 186, 76, 0.3);
    border-radius: 5px;
    color: #f2f2f2;
    font-family: inherit;
    font-size: 0.88rem;
    padding: 0.45rem 0.6rem;
}

.period-date-field input[type="date"]:focus {
    outline: none;
    border-color: rgb(206, 186, 76);
}

/* Period summary text */
.period-summary {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    color: rgba(206, 186, 76, 0.6);
    font-style: italic;
}

/* Mode Selection Cards */
.mode-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem 0.75rem;
    background: rgba(13, 40, 73, 0.4);
    border: 2px solid rgba(206, 186, 76, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-card:hover {
    border-color: rgba(206, 186, 76, 0.4);
    background: rgba(13, 40, 73, 0.6);
}

.mode-card.selected {
    border-color: rgb(206, 186, 76);
    background: rgba(206, 186, 76, 0.1);
    box-shadow: 0 0 12px rgba(206, 186, 76, 0.15);
}

.mode-card input[type="radio"] {
    display: none;
}

.mode-icon {
    margin-bottom: 0.5rem;
    color: rgb(206, 186, 76);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.mode-card.selected .mode-icon {
    opacity: 1;
}

.mode-card h4 {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
    color: #f2f2f2;
    font-weight: 600;
}

.mode-card p {
    margin: 0;
    font-size: 0.78rem;
    color: rgba(242, 242, 242, 0.6);
    line-height: 1.3;
}

/* Image File List */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
    background: rgba(13, 40, 73, 0.4);
    border: 1px solid rgba(206, 186, 76, 0.15);
    border-radius: 4px;
    font-size: 0.85rem;
    color: #ddd;
}

.file-item .file-size {
    color: rgba(242, 242, 242, 0.5);
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.file-item .remove-img-btn {
    background: none;
    border: none;
    color: rgba(242, 80, 80, 0.7);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 0.25rem;
    line-height: 1;
    transition: color 0.15s;
}

.file-item .remove-img-btn:hover {
    color: #f55;
}

/* Results */
.results-subtitle {
    font-size: 0.9rem;
    color: rgb(206, 186, 76);
    margin: 1.25rem 0 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.warning-text {
    color: #f0c040 !important;
}

/* Entries Table */
.entries-table-wrap {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(206, 186, 76, 0.2);
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.entries-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.entries-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.entries-table th {
    background: rgba(13, 40, 73, 0.9);
    color: rgb(206, 186, 76);
    padding: 0.5rem 0.6rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid rgba(206, 186, 76, 0.3);
}

.entries-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #ddd;
    vertical-align: top;
}

.entries-table tr:hover td {
    background: rgba(206, 186, 76, 0.05);
}

.entries-table .amount-cell {
    text-align: right;
    font-family: "Courier New", monospace;
    white-space: nowrap;
}

/* Info Steps */
.info-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.step-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgb(83, 78, 3), rgb(175, 164, 5));
    color: #0D2849;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-step strong {
    color: rgb(206, 186, 76);
    display: block;
    margin-bottom: 0.15rem;
}

.info-step p {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(242, 242, 242, 0.65);
    line-height: 1.4;
}

/* Loading Detail Text */
.loading-detail {
    color: rgba(242, 242, 242, 0.6);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* ============================================
   Sales Tax Reference Section
   ============================================ */
.tax-reference-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(206, 186, 76, 0.15);
}

/* Collapsible toggle button */
.tax-ref-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
}

.tax-ref-toggle h4 {
    font-size: 1.1rem;
    color: rgb(206, 186, 76);
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.tax-ref-toggle:hover h4 {
    opacity: 0.85;
}

.tax-ref-chevron {
    color: rgba(206, 186, 76, 0.5);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.tax-ref-toggle:hover .tax-ref-chevron {
    color: rgb(206, 186, 76);
}

.tax-ref-body.collapsed .tax-ref-chevron,
.tax-reference-section:has(.tax-ref-body.collapsed) .tax-ref-chevron {
    transform: rotate(-90deg);
}

/* Collapsible body */
.tax-ref-body {
    overflow: hidden;
    max-height: 2000px;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    opacity: 1;
}

.tax-ref-body.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.tax-ref-subtitle {
    font-size: 0.85rem;
    color: rgba(242, 242, 242, 0.6);
    margin: 0 0 1.25rem;
}

.tax-ref-subtitle strong {
    color: #f2f2f2;
}

.tax-ref-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.tax-ref-card {
    background: rgba(13, 40, 73, 0.4);
    border: 1px solid rgba(206, 186, 76, 0.15);
    border-radius: 8px;
    padding: 1.1rem 1rem;
    display: flex;
    flex-direction: column;
}

.tax-ref-card:hover {
    border-color: rgba(206, 186, 76, 0.3);
}

.tax-ref-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: rgb(206, 186, 76);
}

.tax-ref-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #f2f2f2;
}

.tax-ref-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem;
    flex: 1;
}

.tax-ref-list li {
    position: relative;
    padding: 0.3rem 0 0.3rem 0.9rem;
    font-size: 0.8rem;
    color: rgba(242, 242, 242, 0.75);
    line-height: 1.45;
}

.tax-ref-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.65rem;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgb(206, 186, 76);
    opacity: 0.6;
}

.tax-ref-list li strong {
    color: #f2f2f2;
}

.tax-ref-list li em {
    color: rgb(206, 186, 76);
    font-style: italic;
}

.tax-ref-exceptions {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 5px;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.78rem;
    color: rgba(242, 242, 242, 0.65);
    line-height: 1.4;
}

.tax-ref-exceptions > strong {
    display: block;
    color: rgb(206, 186, 76);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.3rem;
}

.tax-ref-exceptions ul {
    list-style: disc;
    padding-left: 1.1rem;
    margin: 0;
}

.tax-ref-exceptions li {
    margin-bottom: 0.15rem;
}

.tax-ref-exceptions li strong {
    color: #f2f2f2;
}

.tax-ref-link {
    display: inline-block;
    font-size: 0.78rem;
    color: rgb(206, 186, 76);
    text-decoration: none;
    font-weight: 600;
    padding: 0.3rem 0;
    transition: opacity 0.15s;
    margin-top: auto;
}

.tax-ref-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.tax-ref-links-group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: auto;
}

/* Responsive */
@media (max-width: 900px) {
    .tax-ref-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .mode-cards {
        grid-template-columns: 1fr;
    }
    .mode-card {
        flex-direction: row;
        text-align: left;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }
    .mode-icon {
        margin-bottom: 0;
    }
    .period-row {
        flex-direction: column;
    }
    .period-presets {
        width: 100%;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .result-actions {
        flex-direction: column;
    }
    .download-btn, .secondary-btn {
        width: 100%;
        justify-content: center;
    }
}
