/* page/companies.php styles */

.section-header {
    text-align: center;
    padding: 60px 0;
    background: #00aeef;
    color: #414042;
    margin-bottom: 40px;
    border-radius: 16px 16px 0 0;
}

.section-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: white;
}

.section-header p {
    color: white;
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

.search-card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-top: -30px;
    margin-bottom: 20px;
    position: relative;
    z-index: 10;
    animation: fadeIn 0.8s ease-out forwards;
}

.unified-search-container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 8px;
    border-radius: 50px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    border: 1px solid #f7941e;
    transition: all 0.3s ease;
}

.unified-search-container:focus-within {
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.15);
    border-color: #00aeef;
    transform: translateY(-2px);
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 15px;
}

.search-input-wrapper i {
    color: #00aeef;
    font-size: 1.2rem;
}

/* 
   Legacy margins removed in favor of logical gap property 
   [dir="rtl"] .search-input-wrapper i { margin-left: 15px; }
   [dir="ltr"] .search-input-wrapper i { margin-right: 15px; }
*/

.search-input-wrapper input {
    border: none;
    width: 100%;
    padding: 15px 0;
    font-size: 1.1rem;
    color: #414042;
    outline: none;
    background: transparent;
}

.btn-unified-search {
    background: #00aeef;
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.btn-unified-search:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
    color: white;
}

.company-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin-bottom: 25px;
    transition: all 0.3s;
    border: 1px solid #f7941e;
    height: 100%;
    /* text-align: center; removed to allow natural flow */
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center items but keep text flow natural */
    animation: fadeIn 0.6s ease-out forwards;
}

.company-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.15);
    border-color: #00aeef;
}

.company-logo-container {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #00aeef;
    margin: 0 auto 20px;
    color: white;
    font-weight: bold;
    font-size: 2rem;
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
    padding: 10px;
}

.company-logo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.company-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #414042;
    margin-bottom: 5px;
}

.company-industry {
    font-weight: 600;
    color: #00aeef;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.company-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
    color: #6c757d;
    font-size: 0.95rem;
}

.company-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.company-meta-item i {
    color: #00aeef;
    font-size: 0.9rem;
}

.company-stats {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-weight: 800;
    font-size: 1.2rem;
    color: #00aeef;
    margin-bottom: 5px;
}

.stat-label {
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: 500;
}

.btn-action {
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-outline-primary:hover {
    background: #00aeef;
    color: white;
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, #00aeef 0%, #009bd5 100%);
    border: none;
    padding: 14px 30px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(37, 99, 235, 0.4);
    color: white;
}

.pagination-container {
    margin-top: 40px;
}

.pagination .page-item .page-link {
    color: #00aeef;
    font-weight: 500;
    border-radius: 10px;
    margin: 0 3px;
    border: none;
    min-width: 40px;
    text-align: center;
    direction: ltr;
    /* Force LTR for pagination to keep arrows consistent if handled by content */
}

[dir="rtl"] .pagination .page-item .page-link {
    direction: ltr;
    /* Keep arrows from flipping if they are characters */
}

/* Ensure grid layout directionality */
[dir="rtl"] .company-detail-grid {
    direction: rtl;
}

.pagination .page-item.active .page-link {
    background: #00aeef;
    color: white;
    border-color: #00aeef;
}

.pagination .page-item:hover .page-link {
    background: rgba(37, 99, 235, 0.1);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.custom-modal {
    background: white;
    border-radius: 24px;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.4s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.modal-overlay.active .custom-modal {
    transform: scale(1);
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #00aeef;
    color: white;
    border-radius: 24px 24px 0 0;
}

/* Force Primary Color Override */
.bg-primary {
    background-color: #00aeef !important;
}

.text-primary {
    color: #00aeef !important;
}

.badge.bg-primary {
    background-color: #00aeef !important;
}

.btn-primary {
    background-color: #00aeef !important;
    border-color: #00aeef !important;
}

.btn-outline-primary {
    color: #00aeef !important;
    border-color: #00aeef !important;
}

.btn-outline-primary:hover {
    background-color: #00aeef !important;
    color: white !important;
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.company-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.detail-item {
    text-align: center;
    padding: 15px;
    border-radius: 16px;
    background: #f8fafc;
    border-inline-start: 4px solid #00aeef;
    /* Logical Border Start */
}

/* [dir] specific borders removed in favor of logical property */

.detail-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.1);
    margin: 0 auto 10px;
    color: #00aeef;
    font-size: 1.3rem;
}

.detail-value {
    font-weight: 700;
    font-size: 1.2rem;
    color: #414042;
    margin: 5px 0;
}

.detail-label {
    color: #6c757d;
    font-size: 0.9rem;
}

.section-subtitle {
    font-weight: 700;
    margin: 25px 0 15px;
    color: #414042;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-subtitle i {
    color: #00aeef;
}

.job-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s;
    border-inline-start: 4px solid #00aeef;
    /* Logical Border Start */
}

/* Logical border handles direction automatically */

.job-item:hover {
    background: #eef2ff;
}

[dir="rtl"] .job-item:hover {
    transform: translateX(5px);
}

[dir="ltr"] .job-item:hover {
    transform: translateX(5px);
    /* Same for LTR positive */
}

.job-title {
    font-weight: 700;
    color: #414042;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
    color: #6c757d;
    font-size: 0.9rem;
}

.job-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.job-meta-item i {
    color: #00aeef;
    font-size: 0.8rem;
}

.form-control,
.form-select {
    border-radius: 12px;
    padding: 12px 18px;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    transition: all 0.3s;
}

.form-control:focus,
.form-select:focus {
    background-color: #fff;
    border-color: #00aeef;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    outline: none;
}

.filter-badge {
    background: #00aeef;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
    margin: 5px;
    font-weight: 500;
}

.filter-badge i {
    cursor: pointer;
}

[dir="rtl"] .filter-badge i {
    margin-left: 5px;
}

[dir="ltr"] .filter-badge i {
    margin-right: 5px;
}

.filter-badge i:hover {
    color: #ef4444;
}

.btn-search {
    background: linear-gradient(135deg, #00aeef 0%, #009bd5 100%);
    border: none;
    padding: 12px 25px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s;
    color: white;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.4);
    color: white;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-card {
    animation-delay: 0.1s;
}

.company-card:nth-child(1) {
    animation-delay: 0.3s;
}

.company-card:nth-child(2) {
    animation-delay: 0.4s;
}

.company-card:nth-child(3) {
    animation-delay: 0.5s;
}

@media (max-width: 991px) {
    .company-meta {
        flex-direction: column;
        gap: 8px;
    }

    .company-stats {
        flex-wrap: wrap;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .section-header h1 {
        font-size: 2rem;
    }

    .search-card {
        padding: 20px;
    }

    .company-card {
        padding: 20px;
    }

    .company-name {
        font-size: 1.2rem;
    }

    .company-detail-grid {
        grid-template-columns: 1fr;
    }

    .job-meta {
        flex-direction: column;
        gap: 8px;
    }
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 174, 239, 0.1);
    border-top: 5px solid #00aeef;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}