/* Modal.css - Complete file for JobHunter welcome modal fixes */

/* Base modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: auto;
}

/* Active state - modal is visible */
.modal.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

/* Closing state for transition */
.modal.closing {
    opacity: 0;
}

/* Modal content container with transitions */
.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 500px;
    position: relative;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Modal content transition when active */
.modal.active .modal-content {
    transform: translateY(0);
    opacity: 1;
}

/* Fix modal button positioning */
.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
    /* Reduced from 15px */
    position: static;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
}

/* Close button styling */
.close-modal {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--light-text);
    z-index: 10;
}

.close-modal:hover {
    color: var(--text-color);
}

/* Welcome modal specific adjustments */
#welcome-guidance-modal .modal-content {
    max-width: 550px;
    padding-bottom: 45px;
    /* Reduced from 70px */
}

/* Welcome modal content area */
.welcome-content-scrollable {
    max-height: 70vh;
    /* More scrollable area */
    overflow-y: auto;
    padding-right: 10px;
    padding-bottom: 5px;
    /* Reduced padding */
    margin-bottom: 5px;
    /* Reduced margin */
    -webkit-overflow-scrolling: touch;
}

/* Make scrollbar more attractive */
.welcome-content-scrollable::-webkit-scrollbar {
    width: 8px;
}

.welcome-content-scrollable::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.welcome-content-scrollable::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.welcome-content-scrollable::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Enhanced styling for welcome guidance content */
.welcome-guidance h4 {
    color: var(--primary-color);
    margin-top: 16px;
    margin-bottom: 8px;
}

.welcome-guidance p {
    margin-bottom: 12px;
    line-height: 1.5;
}

.welcome-guidance ul,
.welcome-guidance ol {
    padding-left: 24px;
    margin-bottom: 12px;
}

.welcome-guidance li {
    margin-bottom: 6px;
}

.welcome-guidance .notes {
    font-style: italic;
    color: var(--light-text);
    border-top: 1px solid #eee;
    padding-top: 12px;
    margin-top: 16px;
}

/* Fixed "Got it" button position */
#got-it-btn {
    position: relative;
    z-index: 5;
    padding: 10px 20px !important;
    /* Reduced padding */
}

.welcome-button {
    margin: 0 !important;
    padding: 10px 20px !important;
    /* Reduced padding */
}

/* Full description modal */
.full-description-modal {
    max-width: 800px;
    max-height: 80vh;
}

.full-description-content {
    max-height: 60vh;
    overflow-y: auto;
    border: 1px solid #eee;
    padding: 15px;
    background-color: #fafafa;
    margin: 15px 0;
}

.full-description-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
}

/* Adjust modal on smaller screens */
@media (max-width: 768px) {
    .modal {
        align-items: center;
        justify-content: center;
        padding: 15px;
    }

    .modal-content {
        margin: 0 auto;
        width: 95%;
        max-width: 95%;
        max-height: 90vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding: 1.5rem;
        /* Reduced overall padding */
        padding-bottom: 45px;
        /* Just enough for the button */
    }

    .welcome-content-scrollable {
        max-height: 65vh;
        /* Increased from 50vh */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .welcome-guidance h4 {
        font-size: 16px;
        margin-top: 12px;
        margin-bottom: 4px;
    }

    .welcome-guidance p,
    .welcome-guidance li {
        font-size: 14px;
    }

    .modal-buttons {
        position: absolute;
        bottom: 10px;
        /* Reduced from 15px */
        left: 0;
        right: 0;
        padding: 0 15px;
        justify-content: center;
    }
}

/* Even smaller screens adjustments */
@media (max-width: 480px) {
    .modal-content {
        width: 100%;
        border-radius: 8px;
        padding: 1.2rem;
        /* Further reduced padding */
        padding-bottom: 40px;
        /* Just enough for the button */
        margin: 10px;
        /* Reduced margin */
        max-height: 85vh;
    }

    .modal-buttons {
        flex-direction: column;
        padding: 0 10px;
    }

    .modal-buttons button {
        width: 100%;
        margin-bottom: 8px;
    }

    .welcome-content-scrollable {
        max-height: 70vh;
        /* Increased from 45vh - most of the screen can be used */
        padding-right: 5px;
    }

    /* Compact button styling - now absolute positioned to stay with modal */
    #got-it-btn {
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: auto;
        min-width: 120px;
        max-width: 80%;
        padding: 8px 16px !important;
        z-index: 2002;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }
}

/* Fix for very small screens */
@media (max-height: 500px) {
    .welcome-content-scrollable {
        max-height: 65vh;
        /* Increased from 40vh */
    }

    .modal-content {
        padding-bottom: 40px;
    }
}

/* Fix issues with iOS browsers */
@supports (-webkit-touch-callout: none) {
    .modal {
        position: fixed;
        height: -webkit-fill-available;
    }

    .welcome-content-scrollable {
        -webkit-overflow-scrolling: touch;
    }

    /* Fix iOS overflow issues */
    .modal-content {
        max-height: 80vh;
        max-height: -webkit-fill-available;
    }
}