/*==========================================================
  Global & Utility Styles
  ==========================================================*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background-color: #f7fafc;
    color: #333;
    line-height: 1.6;
}

.container-wrapper {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.min-h-screen {
    min-height: 100vh;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.p-4 {
    padding: 1rem;
}

.md\:p-8 {
    padding: 2rem;
}

.w-full {
    width: 100%;
}

.max-w-6xl {
    max-width: 72rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.md\:mb-12 {
    margin-bottom: 3rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.text-center {
    text-align: center;
}

/*==========================================================
  Navigation Bar Styles
  ==========================================================*/

.nav-link {
    display: block;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    color: #4a5568;
    transition: color 0.3s, background-color 0.3s, box-shadow 0.3s;
}

.nav-link:hover {
    color: #2b6cb0;
}

.nav-link.active {
    color: #1E40AF;
    font-weight: 700;
    background-color: #EBF4FF;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/*==========================================================
  Calculator Card & Section Styles
  ==========================================================*/

.card,
.calc-container,
.column {
    background-color: white;
    border-radius: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.input-field {
    border-radius: 0.75rem;
    border: 1px solid #d1d5db;
    padding: 0.75rem;
    width: 100%;
    box-sizing: border-box;
}

.currency-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    text-align: right;
    font-weight: 600;
}

.currency-input:focus,
.input-field:focus {
    outline: none;
    border-color: #0056b3;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.2s;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.button-group .btn {
    background-color: #e9ecef;
    color: #333;
    border: 1px solid #ddd;
    flex: 1;
    min-width: 80px;
}

.button-group .btn.active {
    background-color: #28a745;
    color: #fff;
    border-color: #28a745;
}

/*==========================================================
  Result & Summary Section Styles
  ==========================================================*/

.result-section {
    background-color: #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
}

.result-item,
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

.result-item label,
.summary-row span {
    font-weight: 500;
    color: #4a5568;
    flex: 1;
}

.result-value {
    font-weight: 600;
    color: #0056b3;
    text-align: right;
    white-space: nowrap;
}

.result-item.total .result-value {
    color: #28a745;
    font-size: 1.2rem;
}

.summary-container {
    display: flex;
    justify-content: space-around;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.summary-container > div {
    flex: 1;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: left;
    min-width: 300px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.net-summary {
    background-color: #f0fff4;
    border: 2px solid #48bb78;
}

.gross-summary {
    background-color: #e0e0e0;
    border: 2px solid #9e9e9e;
}

.result-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2b6cb0;
    margin: 0 0 0.5rem 0;
    border-bottom: 2px solid #a5d6a7;
    padding-bottom: 0.5rem;
    text-align: center;
}

/*==========================================================
  Specific Component Styles
  ==========================================================*/

/* Dropdown */
.jkk-dropdown-container {
    position: relative;
    cursor: pointer;
    width: 100%;
}

.jkk-dropdown-display {
    background-color: white;
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid #d1d5db;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.jkk-dropdown-options {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
    overflow: hidden;
    display: none;
}

.jkk-dropdown-options.active {
    display: block;
}

.jkk-option {
    padding: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.jkk-option:hover {
    background-color: #f0f4f8;
}

/* Toggle Switch */
.toggle-switch input {
    display: none;
}

.toggle-switch label {
    display: inline-block;
    width: 50px;
    height: 28px;
    background-color: #ccc;
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-switch label:after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #fff;
    top: 4px;
    left: 4px;
    transition: left 0.3s;
}

.toggle-switch input:checked + label {
    background-color: #28a745;
}

.toggle-switch input:checked + label:after {
    left: 26px;
}

.toggle-switch input:disabled + label {
    cursor: not-allowed;
    opacity: 0.5;
}

.nested-options {
    margin-top: -5px;
    margin-bottom: 20px;
    padding-left: 20px;
    border-left: 2px solid #ddd;
}

/* Specific to PPh21 & 23 */
.tax-details-hidden,
.hidden-section {
    display: none !important;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: flex-end;
}

.checkbox-group .flex-item {
    display: flex;
    align-items: center;
    white-space: nowrap;
    min-width: 80px;
}

.checkbox-group input {
    width: auto;
    margin-right: 0.5rem;
}

.select2-container--default .select2-selection--single {
    height: auto;
    min-height: 40px;
    display: flex;
    align-items: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .calc-container {
        padding: 1.5rem;
    }

    .summary-container {
        flex-direction: column;
    }
}