/* DA Calculator - Modern, Mobile-First, Beautiful UI */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    padding: 5px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 10px;
    background: white;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.header-img {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 10px;
}

/* Social Buttons */
.social-buttons {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin: 10px auto;
    max-width: 500px;
    justify-content: center;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    flex: 1;
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.social-btn.telegram {
    background: linear-gradient(135deg, #229ED9 0%, #0088cc 100%);
    color: white;
}

.social-btn.telegram:hover {
    background: linear-gradient(135deg, #0088cc 0%, #229ED9 100%);
}

.social-btn.whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
}

.social-btn.whatsapp:hover {
    background: linear-gradient(135deg, #128C7E 0%, #25D366 100%);
}

.social-btn.facebook {
    background: linear-gradient(135deg, #1877f2 0%, #0d5dbf 100%);
    color: white;
}

.social-btn.facebook:hover {
    background: linear-gradient(135deg, #0d5dbf 0%, #1877f2 100%);
}

.social-btn.twitter {
    background: linear-gradient(135deg, #1da1f2 0%, #0d8bd9 100%);
    color: white;
}

.social-btn.twitter:hover {
    background: linear-gradient(135deg, #0d8bd9 0%, #1da1f2 100%);
}

.social-btn-icon {
    margin-right: 10px;
    font-size: 20px;
}

/* Form Container */
.form-container {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.1);
    margin-bottom: 15px;
    border: 1px solid #e8ecf5;
}

.form-title {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 22px;
    text-align: center;
    font-weight: 700;
    line-height: 1.3;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    color: #34495e;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #d1d9e6;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #2c3e50;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.08);
    background: #ffffff;
}

.btn-submit {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #5568d3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5568d3 0%, #667eea 100%);
}

.btn-submit:active {
    transform: translateY(0);
}

/* Results Container */
.results-container {
    background: white;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-top: 15px;
    overflow-x: auto;
    border: 1px solid #e8ecf5;
}

.results-title {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 20px;
    text-align: center;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #5568d3 100%);
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.35);
}

.summary-card:nth-child(2) {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

.summary-card:nth-child(3) {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.summary-card:nth-child(4) {
    background: linear-gradient(135deg, #074174 0%, #003032 100%);
}

.summary-card-label {
    font-size: 13px;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    margin-bottom: 10px;
}

.summary-card-value {
    font-size: 32px;
    font-weight: 700;
}

/* Table Styles - Beautiful & Neat */
.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.results-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.results-table th {
    padding: 15px 12px;
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
    border: none;
}

.results-table tbody tr {
    transition: all 0.2s ease;
}

.results-table tbody tr:nth-child(odd) {
    background-color: #f5f7fa;
}

.results-table tbody tr:nth-child(even) {
    background-color: #ffffff;
}

.results-table tbody tr:nth-child(odd) td {
    background-color: #f5f7fa;
    border-color: #e1e8ed;
}

.results-table tbody tr:nth-child(even) td {
    background-color: #ffffff;
    border-color: #e1e8ed;
}

.results-table tbody tr:hover {
    background-color: #e6f2ff !important;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.results-table td {
    padding: 10px 8px;
    text-align: center;
    border: 1px solid #e1e8ed;
    font-weight: 500;
    font-size: 13px;
}

.results-table tbody tr.total-row {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
    color: white !important;
    font-weight: 700;
    font-size: 15px;
}

.results-table tbody tr.total-row td,
.results-table tbody tr.total-row th {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
    color: white !important;
    border-color: rgba(255,255,255,0.2) !important;
}

.results-table tbody tr.subtotal-row {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%) !important;
    color: white !important;
    font-weight: 600;
}

.results-table tbody tr.subtotal-row td,
.results-table tbody tr.subtotal-row th {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%) !important;
    color: white !important;
    border-color: rgba(255,255,255,0.2) !important;
}

/* Ensure inline styled rows (surrender leave, installment) are visible */
.results-table tbody tr[style*="background"] {
    color: white !important;
}

.results-table tbody tr[style*="background"] td,
.results-table tbody tr[style*="background"] th {
    color: white !important;
    background: inherit !important;
}

/* Download Button */
.btn-download {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 30px auto;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-download:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* Hide classes */
.slgrphide {
    display: none !important;
}

.aasdiv {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }
    
    .form-container,
    .results-container {
        padding: 15px;
        border-radius: 10px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .form-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .results-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .summary-card {
        padding: 15px;
    }
    
    .summary-card-value {
        font-size: 22px;
    }
    
    /* Mobile Table - Perfect Responsive with Wrapped Headings */
    .results-table {
        font-size: 11px;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        display: table;
        min-width: 100%;
    }
    
    .results-table thead th {
        padding: 10px 4px;
        text-align: center;
        font-size: 11px;
        white-space: normal;
        word-wrap: break-word;
        line-height: 1.3;
        font-weight: 600;
    }
    
    .results-table tbody td {
        padding: 10px 4px;
        text-align: center;
        font-size: 13px;
        white-space: nowrap;
        word-break: keep-all;
    }
    
    .results-table th:first-child,
    .results-table td:first-child {
        min-width: 75px;
        max-width: 85px;
        font-weight: 600;
    }
    
    /* Compress columns on mobile */
    .results-table th,
    .results-table td {
        min-width: 60px;
        max-width: 80px;
    }
    
    /* Social buttons - side by side on mobile */
    .social-buttons {
        flex-direction: row;
        gap: 8px;
        margin: 10px auto;
        max-width: 100%;
    }
    
    .social-btn {
        flex: 1;
        padding: 12px 10px;
        font-size: 13px;
    }
    
    .social-btn-icon {
        font-size: 18px;
        margin-right: 6px;
    }
    
    /* Designed by section - Mobile friendly */
    .designed-by-row td {
        padding: 12px 8px !important;
    }
    
    .designed-by-row strong {
        font-size: 12px !important;
        display: block;
        word-wrap: break-word;
    }
}

@media (max-width: 480px) {
    .form-container,
    .results-container {
        padding: 12px;
    }
    
    .form-title {
        font-size: 16px;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .results-table {
        font-size: 10px;
        min-width: 100%;
        width: 100%;
    }
    
    .results-table thead th {
        padding: 9px 3px;
        font-size: 10px;
        white-space: normal;
        word-wrap: break-word;
        line-height: 1.25;
    }
    
    .results-table tbody td {
        padding: 9px 3px;
        font-size: 12px;
    }
    
    /* Increase column widths for better readability */
    .results-table th:first-child,
    .results-table td:first-child {
        min-width: 70px;
    }
    
    .results-table th:not(:first-child),
    .results-table td:not(:first-child) {
        min-width: 60px;
    }
    
    /* Ensure total/subtotal rows are visible on mobile */
    .results-table tbody tr.total-row,
    .results-table tbody tr.subtotal-row {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
        color: white !important;
    }
    
    .results-table tbody tr.total-row td,
    .results-table tbody tr.total-row th,
    .results-table tbody tr.subtotal-row td,
    .results-table tbody tr.subtotal-row th {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
        color: white !important;
    }
    
    /* Ensure inline styled rows (surrender, installment) are visible on mobile */
    .results-table tbody tr[style*="background"] {
        color: white !important;
    }
    
    .results-table tbody tr[style*="background"] td,
    .results-table tbody tr[style*="background"] th {
        color: white !important;
        background: inherit !important;
    }
    
    .social-buttons {
        flex-direction: row;
        gap: 6px;
    }
    
    .social-btn {
        padding: 10px 8px;
        font-size: 12px;
        flex: 1;
    }
    
    .summary-card-value {
        font-size: 20px;
    }
}

/* Facebook Comments Section - Stylish Design */
.fb-comments-container {
    margin: 40px auto;
    max-width: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 30px 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e8ed;
}

.fb-comments-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e1e8ed;
}

.fb-comments-icon {
    font-size: 48px;
    margin-bottom: 10px;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.fb-comments-title {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 10px 0 8px 0;
    line-height: 1.3;
}

.fb-comments-subtitle {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    font-weight: 500;
}

.fb-comments-wrapper {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
}

.fb-comments-wrapper .fb-comments {
    width: 100% !important;
}

/* Mobile Responsive for Comments */
@media (max-width: 768px) {
    .fb-comments-container {
        margin: 30px auto;
        padding: 20px 15px;
        border-radius: 12px;
    }
    
    .fb-comments-header {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .fb-comments-icon {
        font-size: 40px;
    }
    
    .fb-comments-title {
        font-size: 20px;
    }
    
    .fb-comments-subtitle {
        font-size: 13px;
    }
    
    .fb-comments-wrapper {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .fb-comments-container {
        margin: 20px auto;
        padding: 15px 10px;
    }
    
    .fb-comments-title {
        font-size: 18px;
    }
    
    .fb-comments-subtitle {
        font-size: 12px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .form-container,
    .social-buttons,
    .btn-download {
        display: none;
    }
    
    .results-container {
        box-shadow: none;
    }
}

/* Add More Surrender Leave Button */
.btn-add-more-sl {
    width: 100%;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #667eea;
    background: white;
    border: 2px dashed #667eea;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-add-more-sl:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Surrender Leave Container */
.surrender-leave-item {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.surrender-leave-item:hover {
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}
