/* Calculate Tariffs Specific Styles */

/* Override body constraints for full-width design */
body {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #FFF;
    font-family: "Nunito Sans", sans-serif;
}

/* Header styles are now in shared/header.css via global.css */
/* Additional duties-calculator specific header adjustments */
.header-container {
    /* Removed conflicting styles - using shared header.css */
}

.calculator-container {
    max-width: 1240px;
    margin: 30px auto 0;
    padding: 0 20px;
}

.calculator-container h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.subtitle {
    color: #6c757d;
    margin-bottom: 30px;
}

.package-details-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 25px;
    gap: 20px;
}

.package-details-header h3 {
    margin: 0;
    color: #495057;
}

.arrival-date-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 200px;
}

.arrival-date-container label {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

.date-input {
    height: 32px;
    padding: 0 12px;
    border: 1px solid #E6E6E6;
    border-radius: 8px;
    background: #FFF;
    font-size: 14px;
    outline: none;
    font-family: "Nunito Sans", sans-serif;
    transition: border-color 0.2s ease;
}

.date-input:focus {
    border-color: #004385;
    box-shadow: 0 0 0 2px rgba(0, 67, 133, 0.1);
}

.input-form {
    background: white;
    padding: 25px;
    margin-bottom: 30px;
}

.items-section {
    margin-bottom: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h4 {
    margin: 0;
    color: #495057;
}

.btn-add-item {
    display: flex;
    height: 32px;
    padding: 8px 12px;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    background: #004385;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-family: "Nunito Sans", sans-serif;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-add-item:hover {
    background: #003166;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.add-icon {
    font-size: 16px;
    font-weight: bold;
}

/* Items Table Styles */
.items-table {
    margin-top: 20px;
}

.table-header {
    display: flex;
    height: 56px;
    padding: 0 16px;
    align-items: center;
    gap: 32px;
    align-self: stretch;
    border-radius: 4px;
    background: #F7F8F9;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.table-row {
    display: flex;
    height: 56px;
    padding: 0 16px;
    align-items: center;
    gap: 32px;
    align-self: stretch;
    border-radius: 8px;
    border: 1px dashed #CCC;
    background: #F7F8F9;
    margin-bottom: 8px;
}

.header-country,
.row-country {
    flex: 2;
    margin-right: 16px;
}

.header-classification,
.row-classification {
    flex: 1.2;
}

.header-price,
.row-price {
    flex: 1.5;
}

.header-quantity,
.row-quantity {
    flex: 1;
}

.header-value,
.row-value {
    flex: 1;
    text-align: right;
}

.header-actions,
.row-actions {
    flex: 0 0 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Input Field Styles */
.price-input {
    display: flex;
    width: 164px;
    height: 32px;
    padding: 0 16px;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    border: 1px solid #E6E6E6;
    background: #FFF;
    font-size: 14px;
    outline: none;
}

.country-select,
.classification-select {
    width: 100%;
    height: 32px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid #E6E6E6;
    background: #FFF;
    font-size: 14px;
    outline: none;
    font-family: "Nunito Sans", sans-serif;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.classification-select:hover,
.classification-select:focus {
    border-color: #004385;
    box-shadow: 0 0 0 2px rgba(0, 67, 133, 0.1);
}

.price-input-container {
    display: flex;
    align-items: center;
    position: relative;
}

.currency-symbol {
    position: absolute;
    left: 16px;
    color: #666;
    font-size: 14px;
    z-index: 1;
}

.price-input {
    padding-left: 32px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #E6E6E6;
    background: #FFF;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

.quantity-btn:hover {
    background: #F7F8F9;
}

.quantity-display {
    font-size: 14px;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

.row-value {
    font-weight: 600;
    color: #333;
}

.btn-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #dc3545;
    background: transparent;
    color: #dc3545;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.btn-delete:hover:not(:disabled) {
    background: #dc3545;
    color: white;
}

.btn-delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #ccc;
    color: #ccc;
}

.item-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 15px;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: 600;
    color: #495057;
}

.btn-remove {
    background: #dc3545;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: background-color 0.3s;
}

.btn-remove:hover {
    background: #c82333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #495057;
    font-weight: 500;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-row-three {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.btn-calculate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    font-size: 16px;
    padding: 12px 24px;
    margin-top: 10px;
    background-color: #004385;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: "Nunito Sans", sans-serif;
}

.btn-calculate:hover:not(:disabled) {
    background-color: #003166;
}

.btn-calculate:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Secondary Buttons (Calculate Another, Print Results) */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    padding: 10px 20px;
    background-color: white;
    color: #004385;
    border: 2px solid #004385;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: "Nunito Sans", sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: #004385;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 67, 133, 0.15);
}

/* Results Section */
.results-section {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.results-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}


/* Invoice-style Totals */
.invoice-totals {
    margin-top: 20px;
    width: 100%;
    border-top: 1px solid #dee2e6;
    padding: 15px 0;
    border-radius: 8px;
    background: #F7F8F9;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    max-width: 300px;
    margin-left: auto;
    font-size: 12px;
}

.total-row:not(.final-total) {
    border-bottom: 1px solid #f0f0f0;
}

.total-row.final-total {
    padding: 2px 4px;
    font-weight: bold;
    font-size: 14px;
}

.total-label {
    color: #6c757d;
    font-size: 12px;
}

.final-total .total-label {
    color: #2c3e50;
    font-weight: bold;
}

.total-value {
    font-weight: 600;
    color: #2c3e50;
}

.breakdown-section {
    margin-top: 30px;
}

.breakdown-section h4 {
    color: #495057;
    margin-bottom: 15px;
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
}

.breakdown-table th {
    background: #f8f9fa;
    padding: 10px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    font-size: 14px;
    color: #495057;
}

/* Right align numeric columns (Quantity, Declared Value, Tariff %, Tariff) */
.breakdown-table th:nth-child(4),
.breakdown-table th:nth-child(5), 
.breakdown-table th:nth-child(6),
.breakdown-table th:nth-child(7) {
    text-align: right;
}

.breakdown-table td {
    padding: 10px;
    border-bottom: 1px solid #dee2e6;
    font-size: 14px;
    text-align: left;
}

/* Right align numeric columns data */
.breakdown-table td:nth-child(4),
.breakdown-table td:nth-child(5),
.breakdown-table td:nth-child(6), 
.breakdown-table td:nth-child(7) {
    text-align: right;
}

.breakdown-table tbody tr:hover {
    background: #f8f9fa;
}

.actions-section {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.actions-section button {
    flex: 1;
}

/* Footer */
.footer {
    border-top: 1px solid #dee2e6;
    margin-top: 40px;
    background: #f8f9fa;
    padding: 30px 0;
}

.footer-content {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: center;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.disclaimer {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    font-style: italic;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.footer-link {
    color: #004385;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #002851;
    text-decoration: underline;
}

.footer-separator {
    color: #6c757d;
    font-size: 14px;
}

.copyright {
    font-size: 14px;
    color: #495057;
    margin: 0;
    font-weight: 500;
}

/* Print Styles */
@media print {
    .language-switcher,
    .btn-add-item,
    .btn-remove,
    .btn-calculate,
    .actions-section,
    .input-form {
        display: none !important;
    }
    
    .results-section {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    .header-container {
        border-bottom: 1px solid #000;
    }
}

/* Responsive Design */
/* Header responsive styles handled by shared/header.css */

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    
    .form-row,
    .form-row-three {
        grid-template-columns: 1fr;
    }
    
    .results-summary {
        grid-template-columns: 1fr;
    }
    
    .actions-section {
        flex-direction: column;
    }
    
    .breakdown-table {
        font-size: 12px;
    }
    
    .breakdown-table th,
    .breakdown-table td {
        padding: 8px 5px;
    }

    /* Mobile styles for table */
    .items-table {
        overflow-x: auto;
    }

    .table-header,
    .table-row {
        min-width: 800px;
        gap: 16px;
    }

    .price-input,
    .country-select,
    .classification-select {
        width: 100%;
        min-width: 100px;
    }

    .header-country,
    .row-country {
        flex: 2;
    }

    .header-classification,
    .row-classification {
        flex: 1;
    }

    .header-price,
    .row-price {
        flex: 1.2;
    }

    .header-quantity,
    .row-quantity {
        flex: 1;
    }

    .header-value,
    .row-value {
        flex: 1;
    }

    /* Mobile styles for package details header */
    .package-details-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .arrival-date-container {
        min-width: 100%;
    }

    /* Mobile footer styles */
    .footer-links {
        flex-direction: column;
        gap: 12px;
    }

    .footer-separator {
        display: none;
    }
}

/* Searchable Dropdown Styles */
.searchable-dropdown {
    position: relative;
    width: 100%;
}

.row-country {
    position: relative;
    overflow: visible;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 32px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid #E6E6E6;
    background: #FFF;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-trigger:hover {
    border-color: #004385;
}

.dropdown-trigger.has-value {
    color: #333;
}

.dropdown-trigger .placeholder {
    color: #999;
}

.dropdown-arrow {
    transition: transform 0.2s ease;
    color: #666;
    flex-shrink: 0;
}

.dropdown-arrow.rotate-180 {
    transform: rotate(180deg);
}

.dropdown-panel {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 100;
    background: white;
    border: 1px solid #E6E6E6;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
    max-height: 200px;
    overflow: hidden;
}

.search-container {
    position: relative;
    padding: 8px;
    border-bottom: 1px solid #E6E6E6;
}

.search-input {
    width: 100%;
    height: 32px;
    padding: 0 32px 0 12px;
    border: 1px solid #E6E6E6;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.search-input:focus {
    border-color: #004385;
    box-shadow: 0 0 0 2px rgba(0, 67, 133, 0.1);
}

.clear-button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: none;
    background: #999;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.clear-button:hover {
    background: #666;
}

.options-container {
    max-height: 150px;
    overflow-y: auto;
}

.option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.option:hover {
    background-color: #F7F8F9;
}

.option.selected {
    background-color: #004385;
    color: white;
}

.option .country-code {
    font-size: 12px;
    color: #666;
    background: #F7F8F9;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.option.selected .country-code {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.no-results {
    padding: 12px;
    text-align: center;
    color: #666;
    font-size: 14px;
    font-style: italic;
}

/* Transitions for dropdown */
[x-cloak] { display: none !important; }