:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --highlight-color: #3498db;
    --background-color: #f8f9fa;
    --border-color: #dee2e6;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: var(--background-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    padding: 30px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

h1 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
}

h2 {
    color: var(--secondary-color);
    font-size: 18px;
    margin-top: 30px;
    margin-bottom: 15px;
}

.report-section {
    margin-bottom: 30px;
}

.header-text {
    text-align: justify;
    margin-bottom: 25px;
    line-height: 1.8;
}

.header-text.editable {
    padding: 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.header-text.editable:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

.header-text.editable:focus {
    background-color: #fff;
    outline: none;
    box-shadow: 0 0 0 1px var(--highlight-color);
}

.header-text.editable .highlight.essential {
    display: inline-block;
    position: relative;
    cursor: text;
}

.highlight {
    background-color: #f0f8ff;
    padding: 2px 5px;
    border-radius: 3px;
    border: 1px solid #e3f2fd;
}

.highlight.essential {
    background-color: #e3f2fd;
    border: 1px solid #bbdefb;
    padding: 2px 5px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.highlight.essential:hover {
    background-color: #bbdefb;
    border-color: #90caf9;
}

.highlight.essential:focus {
    background-color: #fff;
    border-color: var(--highlight-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.highlight.essential.editable {
    transition: font-weight 0.2s;
    margin: 0 2px;
    padding: 2px 4px;
}

.highlight.essential.editable:empty:not(:focus):before {
    content: attr(data-placeholder);
    color: #666;
    font-weight: normal;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

th, td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: left;
}

th {
    background-color: var(--secondary-color);
    color: white;
}

.editable {
    position: relative;
    transition: all 0.2s ease;
}

.editable:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.editable:focus {
    outline: none;
    background-color: #fff;
    box-shadow: 0 0 0 1px var(--highlight-color);
}

th.editable:hover {
    background-color: #34495e;
}

th.editable:focus {
    background-color: #2c3e50;
    color: white;
}

.amount {
    text-align: right;
}

.amount.inr.highlight.essential {
    text-align: right;
}

.add-row-btn {
    background-color: var(--highlight-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 14px;
}

.add-row-btn:hover {
    background-color: #2980b9;
}

.report-footer {
    margin-top: 50px;
    text-align: right;
}

.signature {
    margin-top: 30px;
}

.signature p {
    margin: 5px 0;
}

.exchange-rate {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    padding: 10px;
    background-color: var(--background-color);
    border-radius: 4px;
}

.exchange-rate label {
    flex: 0 0 auto;
    margin-right: 10px;
    color: var(--primary-color);
}

.exchange-rate input {
    width: 80px;
    padding: 5px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.exchange-rate input:focus {
    outline: none;
    border-color: var(--highlight-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.export-buttons {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
}

.export-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.export-btn:hover {
    transform: translateY(-1px);
}

.export-btn.pdf {
    background-color: #e74c3c;
    color: white;
}

.export-btn.pdf:hover {
    background-color: #c0392b;
}

.export-btn.word {
    background-color: #2980b9;
    color: white;
}

.export-btn.word:hover {
    background-color: #2471a3;
}

.export-btn.json {
    background-color: #27ae60;
    color: white;
}

.export-btn.json:hover {
    background-color: #219a52;
}

.export-btn.python-word {
    background-color: #8e44ad;
    color: white;
}

.export-btn.python-word:hover {
    background-color: #7d3c98;
}

.export-btn.home {
    background-color: #4CAF50;
    color: white;
    margin-right: 10px;
}

.currency-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

.currency-select-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.currency-select-container select {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.exchange-rate {
    display: flex;
    align-items: center;
    gap: 10px;
}

.exchange-rate input {
    width: 80px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.currency-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--highlight-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.currency-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#targetCurrency {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.exchange-rate {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

#refreshRate {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--highlight-color);
    padding: 4px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

#refreshRate:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

#refreshRate.loading {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.foreign-currency {
    transition: all 0.3s ease;
}

.foreign-currency.hidden,
th.foreign-currency.hidden,
td.foreign-currency.hidden {
    display: none !important;
    width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

tr.total-row td.foreign-currency.hidden {
    display: none !important;
}

.foreign-currency.hidden {
    display: none;
}

.header-text {
    line-height: 1.6;
    margin-bottom: 20px;
}

.header-text p {
    margin: 10px 0;
}

.inline-applicants {
    display: block;
    margin: 10px 0;
    width: 100%;
}

.applicant-info {
    display: block;
    margin: 8px 0;
    line-height: 1.8;
    width: 100%;
}

.applicant-info .highlight.essential.editable {
    display: inline-block;
    min-width: 120px;
    margin: 0 4px;
    padding: 2px 4px;
}

.applicant-info .highlight.essential.editable[contenteditable="true"]:empty:before {
    content: attr(data-placeholder);
    color: #999;
}

.applicant-info .highlight.essential.editable:nth-of-type(1) {
    min-width: 150px; /* Name */
}

.applicant-info .highlight.essential.editable:nth-of-type(2) {
    min-width: 140px; /* Relationship */
}

.applicant-info .highlight.essential.editable:nth-of-type(3) {
    min-width: 100px; /* Passport */
}

.applicant-info .highlight.essential.editable:nth-of-type(4) {
    min-width: 200px; /* Address */
}

.plus-sign {
    display: inline-block;
    font-weight: bold;
    margin-right: 5px;
    width: 20px;
    text-align: center;
}

.applicant-info span:not(.plus-sign) {
    margin: 0 2px;
}

.applicant-info span.text-separator {
    margin: 0 4px;
    white-space: nowrap;
}

.add-inline-applicant {
    display: block;
    margin-top: 10px;
    margin-left: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.add-inline-applicant:hover {
    opacity: 1;
}

.add-inline-applicant svg {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

.remove-applicant {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 5px;
    margin-left: 5px;
    vertical-align: middle;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.remove-applicant:hover {
    opacity: 1;
}

.remove-applicant svg {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.applicant-separator-inline {
    display: inline;
    color: var(--text-color);
    font-weight: 500;
    margin: 0 5px;
}

/* Applicant Styles */
#applicants-container {
    margin: 20px 0;
}

.applicant-section {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

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

.applicant-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.2em;
}

.detail-row {
    display: flex;
    margin-bottom: 10px;
    align-items: baseline;
}

.detail-row label {
    min-width: 100px;
    font-weight: 500;
    color: var(--text-color);
}

.detail-row span {
    flex: 1;
    padding: 5px 10px;
    border-radius: 4px;
}

.add-applicant-btn {
    background-color: var(--highlight-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.add-applicant-btn:hover {
    background-color: #2471a3;
}

.remove-applicant-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.remove-applicant-btn:hover {
    background-color: #c0392b;
}

/* Separator styles */
.applicant-separator {
    text-align: center;
    margin: 15px 0;
    font-weight: 500;
    color: var(--text-color);
}

.action-column {
    width: 50px;
    text-align: center;
}

.delete-row-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.delete-row-btn:hover {
    background-color: rgba(231, 76, 60, 0.1);
    transform: scale(1.1);
}

.delete-row-btn svg {
    width: 18px;
    height: 18px;
}

/* Multiple Applicants Styles */
.remove-applicant {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    margin-left: 5px;
    vertical-align: middle;
    opacity: 0.7;
    transition: opacity 0.2s;
    display: inline-block;
}

.remove-applicant:hover {
    opacity: 1;
}

.remove-applicant svg {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.total-row {
    font-weight: bold;
}

.total-row td {
    border-top: 2px solid #000 !important;
}

.total-row td[colspan="2"] {
    text-align: right;
    padding-right: 15px;
}

.total-row .amount {
    font-weight: bold;
}

@media print {
    body {
        padding: 0;
    }
    
    .container {
        margin: 0;
        padding: 0;
    }
    
    .export-buttons,
    .currency-controls,
    .action-column,
    .add-row-btn,
    .delete-row-btn {
        display: none;
    }
}
