/* Apply Page Styles */

* {
    box-sizing: border-box;
}

.apply-container {
    direction: rtl;
    text-align: right;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 40px;
    padding-bottom: 40px;
}

.apply-wrapper {
    width: 100%;
    max-width: 1200px;
    padding: 0 15px;
}

/* @media (max-width: 500px) {
    .apply-wrapper {
        width: 50%;
    }
} */

.apply-title {
    text-align: center;
    margin-bottom: 30px;
    font-weight: bold;
    font-size: 1.8rem;
    color: #0a2342;
}

/* Card Styles */
.apply-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(10, 35, 66, 0.1);
    border: 1px solid #e8f0f5;
}

.apply-card h5 {
    color: #0a2342;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #00bcd4;
}

.apply-card h6 {
    color: #1565c0;
    font-weight: 600;
    margin-bottom: 15px;
    margin-top: 20px;
}

/* Form Controls */
.form-control,
.form-select,
.tagbox-selected {
    border: 2px solid #e0e8f0 !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
    font-size: 0.95rem !important;
    transition: all 0.3s ease !important;
    background-color: #f9fbfc !important;
    min-height: 44px; /* Better touch target for mobile */
    width: 100%;
    box-sizing: border-box;
}

.form-select{
    background-position: left .75rem center !important;
}

.form-control:focus,
.form-select:focus,
.tagbox-selected:focus {
    border-color: #00bcd4 !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1) !important;
}

.form-control::placeholder {
    color: #999;
}

/* Label Styles */
.apply-card label {
    display: block;
    font-weight: 600;
    color: #0a2342;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.apply-card label.required::after {
    content: " *";
    color: #d32f2f;
}

/* Modern Checkbox Styles */
.form-check-input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f9fbfc;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.form-check-input[type="checkbox"]:hover {
    border-color: #00bcd4;
    background-color: #fff;
}

.form-check-input[type="checkbox"]:checked {
    background-color: #00bcd4;
    border-color: #00bcd4;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

.form-check-input[type="checkbox"]:focus {
    border-color: #00bcd4;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.15);
}

/* Modern Radio Button Styles */
.form-check-input[type="radio"] {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e8f0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f9fbfc;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.form-check-input[type="radio"]:hover {
    border-color: #00bcd4;
    background-color: #fff;
}

.form-check-input[type="radio"]:checked {
    border-color: #00bcd4;
    background-color: #fff;
}

.form-check-input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #00bcd4;
    transition: all 0.2s ease;
}

.form-check-input[type="radio"]:focus {
    border-color: #00bcd4;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.15);
}

/* Form Check Label Styles */
.form-check-label {
    font-size: 0.95rem;
    color: #0a2342;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
}

.form-check-inline {
    display: inline-flex;
    align-items: center;
    margin-left: 1rem;
    gap: 0.5rem;
}

.form-check-inline .form-check-input {
    margin-left: 0;
    margin-right: 0;
}

/* Row & Column Spacing */
.apply-card .row {
    margin-right: 0;
    margin-left: 0;
}

.apply-card .row.g-3 > [class*="col-"] {
    padding-right: 10px;
    padding-left: 10px;
}

.apply-card .col-md-4,
.apply-card .col-md-6 {
    padding-right: 10px;
    padding-left: 10px;
}

.apply-card .mb-3 {
    margin-bottom: 18px;
}

/* Table Styles */
.apply-card .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    position: relative;
}

.apply-card .table-responsive::-webkit-scrollbar {
    height: 8px;
}

.apply-card .table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.apply-card .table-responsive::-webkit-scrollbar-thumb {
    background: #00bcd4;
    border-radius: 4px;
}

.apply-card .table-responsive::-webkit-scrollbar-thumb:hover {
    background: #0097a7;
}

.apply-card .table {
    margin-bottom: 0;
    border-collapse: collapse;
    width: 100%;
}

.apply-card .table thead {
    background: #f5f8fa;
    border-bottom: 3px solid #00bcd4;
}

.apply-card .table thead th {
    color: #0a2342;
    font-weight: 700;
    border: none;
    padding: 14px 12px;
    text-align: right;
    font-size: 0.95rem;
}

.apply-card .table tbody tr {
    border-bottom: 1px solid #e8f0f5;
    transition: background 0.2s ease;
}

.apply-card .table tbody tr:hover {
    background: #f9fbfc;
}

.apply-card .table tbody td {
    padding: 10px;
    border: none;
}

/* Table buttons */
.apply-card .table .btn {
    white-space: nowrap;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Modern Add/Remove Button Styles */
.btn-outline-primary {
    background-color: transparent;
    border: 2px solid #00bcd4;
    color: #00bcd4;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
}

.btn-outline-primary:hover {
    background-color: #00bcd4;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
}

.btn-outline-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 188, 212, 0.2);
}

.btn-outline-danger {
    background-color: transparent;
    border: 2px solid #d32f2f;
    color: #d32f2f;
    border-radius: 8px;
    padding: 6px 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-outline-danger:hover {
    background-color: #d32f2f;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}

.btn-outline-danger:active {
    transform: scale(1);
    box-shadow: 0 2px 6px rgba(211, 47, 47, 0.2);
}

/* Small button sizing */
.btn-sm {
    padding: 6px 14px;
    font-size: 0.9rem;
    min-height: 36px;
}

.btn-sm.btn-outline-danger {
    padding: 5px 10px;
    font-size: 0.85rem;
    min-height: 32px;
}

/* Button Styles */
.btn-submit {
    background: linear-gradient(135deg, #00bcd4 0%, #1565c0 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 14px 40px;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
    position: relative;
    overflow: hidden;
    min-height: 48px; /* Better touch target */
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-submit:hover::before {
    left: 100%;
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 188, 212, 0.4);
}

.btn-submit:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
}

.btn-submit:disabled {
    background: linear-gradient(135deg, #b0bec5 0%, #90a4ae 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cal-btn{
    /* border radius circle */
    border-radius: 50% !important;
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Border Styles for sections */
.apply-card > .border {
    border-radius: 8px !important;
    border-color: #e8f0f5 !important;
    padding: 15px !important;
    background: #fafbfc !important;
    margin-bottom: 15px !important;
}

/* Validation Styles */
.apply-card .validation-message {
    color: #d32f2f;
    font-size: 0.85rem;
    margin-top: 4px;
}

/* Responsive */
@media (max-width: 992px) {
    .apply-wrapper {
        max-width: 100%;
    }

    .apply-card .table thead th,
    .apply-card .table tbody td {
        font-size: 0.85rem;
        padding: 8px 6px;
    }
}

@media (max-width: 768px) {
    .apply-container {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .apply-title {
        font-size: 1.4rem;
        margin-bottom: 20px;
    }

    .apply-card {
        padding: 15px;
        margin-bottom: 15px;
    }

    .apply-card h5 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .apply-card .row > [class*="col-"] {
        margin-bottom: 12px;
    }

    .apply-card .col-md-4,
    .apply-card .col-md-6 {
        padding-right: 5px;
        padding-left: 5px;
    }

    .form-control,
    .form-select,
    .tagbox-selected {
        font-size: 0.9rem !important;
        padding: 8px 10px !important;
    }

    /* Responsive Table - Card Layout on Mobile */
    .table-responsive {
        overflow-x: visible;
        border: none;
    }

    .apply-card .table {
        border: none;
        min-width: 100%;
    }

    .apply-card .table thead {
        display: none; /* Hide table headers on mobile */
    }

    .apply-card .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 2px solid #e8f0f5;
        border-radius: 8px;
        padding: 12px;
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .apply-card .table tbody td {
        display: block;
        text-align: right !important;
        border: none;
        padding: 8px 0;
        position: relative;
        padding-right: 45%;
        min-height: 44px;
    }

    .apply-card .table tbody td:before {
        content: attr(data-label);
        position: absolute;
        right: 0;
        width: 42%;
        padding-left: 10px;
        font-weight: 600;
        color: #0a2342;
        white-space: normal;
        display: flex;
        align-items: center;
    }

    /* Hide empty cells or show them minimally */
    .apply-card .table tbody td:empty:before {
        display: none;
    }

    /* Action button cell styling */
    .apply-card .table tbody td:last-child {
        padding-right: 0;
        text-align: center !important;
        border-top: 1px solid #e8f0f5;
        margin-top: 8px;
        padding-top: 12px;
    }

    .apply-card .table tbody td:last-child:before {
        display: none;
    }

    .apply-card .table .form-control,
    .apply-card .table .form-select,
    .apply-card .table .form-control[type="date"],
    .apply-card .table .form-control[type="number"] {
        width: 100%;
        font-size: 0.7rem !important;
        padding: 8px 10px !important;
    }

    .apply-card .table .btn {
        margin: 0 auto;
    }

    .btn-submit {
        padding: 12px 30px;
        font-size: 1rem;
    }

    .file-drop-zone {
        padding: 2rem 1rem;
    }

    .file-drop-text {
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .apply-container {
        padding-top: 15px;
        padding-bottom: 15px;
    }

    .apply-wrapper {
        padding: 0 10px;
    }

    .apply-title {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    .apply-card {
        padding: 12px;
        border-radius: 8px;
    }

    .apply-card h5 {
        font-size: 1rem;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .apply-card h6 {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }

    .apply-card label {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }

    .form-control,
    .form-select,
    .tagbox-selected {
        font-size: 0.85rem !important;
        padding: 7px 9px !important;
        border-radius: 6px !important;
    }

    /* Further optimize table card layout for small screens */
    .apply-card .table tbody tr {
        padding: 10px;
        margin-bottom: 0.8rem;
    }

    .apply-card .table tbody td {
        padding: 6px 0;
        padding-right: 35%;
        font-size: 0.85rem;
    }

    .apply-card .table tbody td:before {
        width: 38%;
        font-size: 0.8rem;
    }

    .apply-card .table .btn {
        font-size: 0.8rem;
        padding: 6px 12px;
        width: 100%;
    }

    .btn-submit {
        padding: 10px 20px;
        font-size: 0.95rem;
        border-radius: 8px;
    }

    .file-drop-zone {
        padding: 1.5rem 1rem;
    }

    .file-drop-text {
        font-size: 0.9rem;
    }

    /* Stack bordered sections */
    .apply-card > .border {
        padding: 10px !important;
        margin-bottom: 10px !important;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 896px) and (orientation: landscape) {
    .apply-container {
        padding-top: 15px;
        padding-bottom: 15px;
    }

    .apply-card {
        padding: 15px;
    }

    .apply-title {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
}

/* Extra small devices (very small phones) */
@media (max-width: 375px) {
    .apply-wrapper {
        padding: 0 8px;
    }

    .apply-card {
        padding: 10px;
    }

    .apply-card h5 {
        font-size: 0.95rem;
    }

    .form-control,
    .form-select,
    .tagbox-selected {
        font-size: 0.8rem !important;
        padding: 6px 8px !important;
        min-height: 40px;
    }

    .btn-submit {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* File Drop Zone */
.file-drop-zone {
    border: 3px dashed #00bcd4;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background: #f5f8fa;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.file-drop-zone:hover {
    border-color: #1565c0;
    background: #eff5f9;
}

.file-drop-zone.drag-over {
    border-color: #1565c0;
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.05) 0%, rgba(21, 101, 192, 0.05) 100%);
    box-shadow: inset 0 0 12px rgba(0, 188, 212, 0.2);
}

.file-drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.file-drop-text {
    margin: 0;
    color: #0a2342;
    font-weight: 600;
    font-size: 1.1rem;
}

.file-input-hidden {
    /* display: none; */
    opacity: 0;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
}
