/* ========== PUBLIC OFFRES PAGE ========== */
.offres-public-page {
    min-height: 100vh;
    background: #111;
    color: #fff;
    font-family: 'Roboto', Arial, sans-serif;
    overflow-y: auto;
    overflow-x: hidden;
}

body {
    overflow: auto !important;
    overflow-x: hidden !important;
}

body.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
}

/* ========== HEADER ========== */
.public-header {
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    padding: 1rem 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
}

.header-logo i {
    color: #074685;
    font-size: 1.5rem;
}

.public-header h1 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ddd;
}

.btn-back {
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid #333;
    transition: all 0.2s ease;
}

.btn-back:hover {
    color: #fff;
    border-color: #555;
    background: #252525;
}

/* ========== INFO BANNER ========== */
.info-banner {
    background: linear-gradient(135deg, #074685, #0a5da8);
    border-bottom: 1px solid #0a5da8;
    padding: 0.75rem 0;
}

.info-banner-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.info-banner-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.info-banner-content {
    flex: 1;
    color: #fff;
}

.info-banner-content p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
}

.info-banner-close {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.info-banner-close:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}

.info-banner-close i {
    font-size: 0.85rem;
}

/* ========== SEARCH ========== */
.public-search {
    background: #1a1a1a;
    padding: 1.5rem 0;
    border-bottom: 1px solid #2a2a2a;
}

.search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.search-input-wrap {
    position: relative;
    flex: 1;
    max-width: 600px;
}

.search-input-wrap i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.search-input-wrap input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    background: #111;
    border: 1px solid #333;
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-family: 'Roboto', Arial, sans-serif;
    transition: border-color 0.3s ease;
}

.search-input-wrap input:focus {
    outline: none;
    border-color: #074685;
}

.search-input-wrap input::placeholder {
    color: #555;
}

.search-count {
    color: #888;
    font-size: 0.95rem;
    white-space: nowrap;
}

.search-count span {
    color: #fff;
    font-weight: 600;
}

/* ========== MAIN ========== */
.public-filters {
    background: #151515;
    padding: 1rem 0;
    border-bottom: 1px solid #2a2a2a;
}

.filters-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filters-label {
    color: #777;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filters-label i {
    font-size: 0.8rem;
}

.filters-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 0.4rem 0.9rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 20px;
    color: #999;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Roboto', Arial, sans-serif;
}

.filter-chip:hover {
    border-color: #555;
    color: #ccc;
}

.filter-chip.active {
    background: #074685;
    border-color: #0a5da8;
    color: #fff;
}

.public-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* ========== OFFRES GRID ========== */
.offres-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.5rem;
}

/* ========== OFFRE CARD ========== */
.offre-public-card {
    background: #1a1a1a;
    border-radius: 14px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    border: 1px solid #2a2a2a;
    transition: border-color 0.3s ease, transform 0.2s ease;
}

.offre-public-card:hover {
    border-color: #074685;
    transform: translateY(-3px);
}

.offre-public-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid #2a2a2a;
    margin-bottom: 0.25rem;
}

/* ========== ENTREPRISE INFO ========== */
.offre-entreprise-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.offre-entreprise-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    background: #074685;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.offre-entreprise-icon i {
    color: #fff;
    font-size: 1rem;
}

.offre-entreprise-icon img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.offre-entreprise-details {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.offre-entreprise-name {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
}

.offre-entreprise-secteur {
    color: #888;
    font-size: 0.8rem;
}

.offre-contrat {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.85rem;
    border-radius: 20px;
    background: rgba(7, 70, 133, 0.2);
    color: #5ba3e8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.offre-public-card h3 {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.offre-public-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: #888;
    font-size: 0.85rem;
}

.offre-public-meta span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.offre-public-meta i {
    color: #074685;
    font-size: 0.8rem;
}

/* Description container */
.offre-desc-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.offre-public-desc {
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.offre-public-desc.is-truncated {
    max-height: 7.2em;
    overflow: hidden;
    position: relative;
}

.offre-public-desc.is-expanded {
    max-height: none;
}

.btn-lire-plus {
    background: none;
    border: none;
    color: #5ba3e8;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Roboto', Arial, sans-serif;
    transition: color 0.2s ease;
    align-self: flex-start;
}

.btn-lire-plus:hover {
    color: #74b5f0;
    text-decoration: underline;
}

.btn-lire-plus i {
    font-size: 0.75rem;
}

.btn-postuler {
    margin-top: auto;
    padding: 0.85rem 1.5rem;
    background: linear-gradient(135deg, #074685, #0a5da8);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: 'Roboto', Arial, sans-serif;
    transition: all 0.3s ease;
}

.btn-postuler:hover {
    background: linear-gradient(135deg, #0a5da8, #0c6bc4);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(7, 70, 133, 0.4);
}

/* ========== EMPTY STATE ========== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 5rem 2rem;
    color: #555;
}

.empty-state i {
    font-size: 3.5rem;
    color: #333;
}

.empty-state p {
    font-size: 1.15rem;
    color: #666;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 5rem 2rem;
    color: #666;
    grid-column: 1 / -1;
}

.loading-state i {
    font-size: 2rem;
    color: #074685;
}

/* ========== MODAL ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #1a1a1a;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #2a2a2a;
    margin: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #2a2a2a;
}

.modal-header h2 {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    width: 36px;
    height: 36px;
    background: #252525;
    border: 1px solid #333;
    border-radius: 8px;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #333;
    color: #fff;
}

/* ========== FORM ========== */
#postulForm {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    color: #ccc;
    font-size: 0.85rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #fff;
    font-size: 0.95rem;
    font-family: 'Roboto', Arial, sans-serif;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #074685;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #555;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ========== CHAR COUNT ========== */
.char-count {
    font-size: 0.75rem;
    font-weight: 400;
    color: #f04040;
    margin-left: 0.5rem;
}

.char-count.char-ok {
    color: #2dd67a;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #2a2a2a;
}

.btn-cancel {
    background: #252525;
    border: 1px solid #333;
    border-radius: 8px;
    color: #b5b5b5;
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: 'Roboto', Arial, sans-serif;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: #333;
    color: #fff;
}

.btn-submit {
    background: linear-gradient(135deg, #074685, #0a5da8);
    border: none;
    border-radius: 8px;
    color: #fff;
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Roboto', Arial, sans-serif;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #0a5da8, #0c6bc4);
    transform: translateY(-1px);
}

/* ========== TOAST ========== */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: 'Roboto', Arial, sans-serif;
    color: #fff;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    background: linear-gradient(135deg, #0d6e3a, #1a9d52);
}

.toast-error {
    background: linear-gradient(135deg, #8b1a1a, #d43030);
}

/* ========== RESPONSIVE MOBILE ========== */
@media (max-width: 768px) {
    /* Header */
    .header-container {
        padding: 0 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .header-logo {
        font-size: 1.1rem;
        gap: 0.5rem;
    }

    .header-logo i {
        font-size: 1.3rem;
    }

    .public-header h1 {
        font-size: 1rem;
    }

    .btn-back {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
        display: none;
    }

    /* Info Banner */
    .info-banner-container {
        padding: 0 1rem;
    }

    .info-banner-content p {
        font-size: 0.85rem;
    }

    .info-banner-close {
        width: 28px;
        height: 28px;
    }

    /* Search */
    .search-container {
        padding: 0 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .search-input-wrap {
        max-width: 100%;
    }

    .search-input-wrap input {
        padding: 0.75rem 1rem 0.75rem 2.5rem;
        font-size: 0.95rem;
    }

    .search-count {
        text-align: center;
        font-size: 0.9rem;
    }

    /* Filters */
    .filters-container {
        padding: 0 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .filters-list {
        width: 100%;
        gap: 0.4rem;
    }

    .filter-chip {
        font-size: 0.78rem;
        padding: 0.35rem 0.75rem;
    }

    /* Main Content */
    .public-main {
        padding: 1.5rem 1rem;
    }

    /* Offres Grid */
    .offres-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    /* Offre Card */
    .offre-public-card {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .offre-public-card h3 {
        font-size: 1.1rem;
    }

    .offre-entreprise-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        max-width: 36px;
        max-height: 36px;
    }

    .offre-entreprise-name {
        font-size: 0.9rem;
    }

    .offre-entreprise-secteur {
        font-size: 0.75rem;
    }

    .offre-contrat {
        font-size: 0.7rem;
        padding: 0.25rem 0.7rem;
    }

    .offre-public-meta {
        font-size: 0.8rem;
        gap: 0.75rem;
    }

    .offre-public-desc {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .btn-postuler {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        max-height: 85vh;
        border-radius: 12px;
    }

    .modal-header {
        padding: 1rem 1.25rem;
    }

    .modal-header h2 {
        font-size: 1.1rem;
    }

    #postulForm {
        padding: 1.25rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .form-group input,
    .form-group textarea {
        font-size: 0.9rem;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn-cancel,
    .btn-submit {
        width: 100%;
        justify-content: center;
        padding: 0.8rem 1.25rem;
    }

    /* Toast */
    .toast-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .toast {
        font-size: 0.85rem;
        padding: 0.75rem 1rem;
    }

    /* Empty State */
    .empty-state {
        padding: 3rem 1.5rem;
    }

    .empty-state i {
        font-size: 2.5rem;
    }

    .empty-state p {
        font-size: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    /* Header ultra-compact */
    .header-container {
        padding: 0 0.75rem;
    }

    .header-logo {
        display: none;
    }

    .public-header h1 {
        font-size: 0.9rem;
        flex: 1;
        text-align: center;
    }

    .btn-back {
        display: none;
    }

    /* Info Banner */
    .info-banner {
        padding: 0.6rem 0;
    }

    .info-banner-container {
        padding: 0 0.75rem;
        gap: 0.6rem;
    }

    .info-banner-icon {
        font-size: 1rem;
    }

    .info-banner-content p {
        font-size: 0.8rem;
        line-height: 1.3;
    }

    .info-banner-close {
        width: 26px;
        height: 26px;
    }

    .info-banner-close i {
        font-size: 0.75rem;
    }

    /* Search */
    .public-search {
        padding: 1rem 0;
    }

    .search-container {
        padding: 0 0.75rem;
        gap: 0.75rem;
    }

    .search-input-wrap input {
        padding: 0.7rem 0.85rem 0.7rem 2.25rem;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .search-input-wrap i {
        left: 0.85rem;
        font-size: 0.9rem;
    }

    .search-count {
        font-size: 0.85rem;
    }

    /* Filters */
    .public-filters {
        padding: 0.75rem 0;
    }

    .filters-container {
        padding: 0 0.75rem;
        gap: 0.5rem;
    }

    .filters-label {
        font-size: 0.8rem;
    }

    .filter-chip {
        font-size: 0.75rem;
        padding: 0.3rem 0.65rem;
    }

    /* Main */
    .public-main {
        padding: 1.25rem 0.75rem;
    }

    .offres-grid {
        gap: 1rem;
    }

    /* Offre Card compact */
    .offre-public-card {
        padding: 1rem;
        gap: 0.75rem;
    }

    .offre-public-header {
        padding-bottom: 0.75rem;
        margin-bottom: 0.15rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .offre-entreprise-info {
        gap: 0.6rem;
        flex: 1;
    }

    .offre-entreprise-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        max-width: 32px;
        max-height: 32px;
    }

    .offre-entreprise-icon i {
        font-size: 0.9rem;
    }

    .offre-entreprise-name {
        font-size: 0.85rem;
    }

    .offre-entreprise-secteur {
        font-size: 0.7rem;
    }

    .offre-contrat {
        font-size: 0.65rem;
        padding: 0.2rem 0.6rem;
        white-space: nowrap;
    }

    .offre-public-card h3 {
        font-size: 1rem;
        line-height: 1.3;
    }

    .offre-public-meta {
        font-size: 0.75rem;
        gap: 0.6rem;
    }

    .offre-public-meta i {
        font-size: 0.75rem;
    }

    .offre-public-desc {
        font-size: 0.8rem;
        line-height: 1.5;
    }

    .offre-public-desc.is-truncated {
        max-height: 6em;
    }

    .btn-lire-plus {
        font-size: 0.8rem;
    }

    .btn-postuler {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
        border-radius: 8px;
    }

    /* Modal */
    .modal-overlay {
        padding: 0;
        align-items: flex-start;
        overflow-y: auto;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: none;
        min-height: 100vh;
        border-radius: 0;
        border: none;
        margin: 0;
        display: flex;
        flex-direction: column;
    }

    .modal-header {
        padding: 0.85rem 1rem;
        flex-shrink: 0;
    }

    .modal-header h2 {
        font-size: 1rem;
    }

    .modal-close {
        width: 32px;
        height: 32px;
    }

    #postulForm {
        padding: 1rem;
        gap: 0.85rem;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .form-group {
        gap: 0.3rem;
    }

    .form-group label {
        font-size: 0.8rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.65rem 0.85rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }

    .form-group textarea {
        min-height: 80px;
    }

    .form-actions {
        padding-top: 0.5rem;
        gap: 0.5rem;
    }

    .btn-cancel,
    .btn-submit {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }

    /* Toast */
    .toast-container {
        top: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
    }

    .toast {
        font-size: 0.8rem;
        padding: 0.65rem 0.85rem;
        border-radius: 8px;
    }

    /* Empty & Loading */
    .empty-state,
    .loading-state {
        padding: 2.5rem 1rem;
    }

    .empty-state i {
        font-size: 2rem;
    }

    .empty-state p {
        font-size: 0.9rem;
    }

    .loading-state i {
        font-size: 1.75rem;
    }
}

/* ========== LANDSCAPE MOBILE FIX ========== */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: 95vh;
    }

    .offre-public-desc.is-truncated {
        max-height: 4.8em;
    }
}

