/*
 * Internships Page Stylesheet
*/

:root {
    --primary: #0a1f44;
    --secondary: #ffcc00;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --text-muted: #6c757d;
}

/* Page Header */
.page-header {
    background-color: var(--primary);
    color: #fff;
    padding: 60px 0;
    text-align: center;
}

.page-header h1 {
    font-weight: 700;
}

.page-header .lead {
    color: rgba(255, 255, 255, 0.8);
    max-width: 700px;
    margin: 1rem auto 0;
}

/* Main Section */
.internship-content-section {
    padding: 80px 0 40px; /* Adjusted padding */
    background-color: #fff;
}

/* Left Sidebar Styles */
.sidebar-wrapper {
    position: sticky;
    top: 120px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.search-box {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.search-box .form-control {
    border-radius: 0.25rem;
}

.internship-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 60vh;
    overflow-y: auto;
}

.internship-list-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    font-weight: 500;
}

.internship-list-item:last-child {
    border-bottom: none;
}

.internship-list-item .icon {
    margin-right: 1rem;
    color: var(--secondary);
    transition: transform 0.2s ease;
}

.internship-list-item:hover {
    background-color: var(--light-bg);
}

.internship-list-item.active {
    background-color: var(--secondary);
    color: #fff;
    font-weight: 600;
}

.internship-list-item.active .icon {
    color: #fff;
    transform: translateX(5px);
}

/* Right Details Content Styles */
.internship-details-content {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 2.5rem;
}

.placeholder-content {
    padding: 4rem 0;
}

.internship-title {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.overview {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.details-section {
    margin-bottom: 2.5rem;
}

.details-section:last-child {
    margin-bottom: 0;
}

.details-section h4 {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary);
    display: inline-block;
}

.details-list,
.check-list {
    list-style: none;
    padding-left: 0;
}

.details-list li,
.check-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 0.75rem;
}

.details-list li::before {
    content: '\f101';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--secondary);
    position: absolute;
    left: 0;
    top: 2px;
}

.check-list li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #198754;
    position: absolute;
    left: 0;
    top: 2px;
}

.apply-list li::before {
    content: '\f007'; /* User icon */
}

.details-list-grid {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.details-list-grid li {
    background: var(--light-bg);
    padding: 1rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
}

.details-list-grid li i {
    color: var(--secondary);
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.enroll-btn {
    padding: 0.8rem 2.5rem;
    font-weight: 600;
    border-radius: 50px;
    background-color: var(--secondary);
    color: var(--primary);
    border: 2px solid var(--secondary);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.enroll-btn:hover {
    background-color: transparent;
    color: var(--secondary);
    border: 2px solid var(--secondary);
}


/* ====================================
   MOBILE ACCORDION STYLES (NEW)
   ==================================== */

/* This div will hold the details inside each list item on mobile. It is hidden by default. */
.internship-mobile-details {
    display: none;
    padding: 1.5rem;
    background-color: var(--light-bg);
    border-top: 1px solid var(--border-color);
    /* Ensures the details div takes the full width below the item title */
    width: 100%; 
    order: 2; /* Used with flex-wrap to ensure it appears after the main item content */
}


/* ====================================
   ENROLLMENT MODAL STYLES
   ==================================== */

#enrollModal .modal-dialog {
    max-width: 900px;
}

#enrollModal .modal-content {
    border-radius: 0.5rem;
    border: none;
}

#enrollModal .modal-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
}

.modal-subtitle {
    color: var(--secondary);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

#enrollModal .modal-title {
    color: var(--primary);
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

#enrollModal .modal-body {
    padding: 2rem;
    background-color: #fff;
}

/* Form Styling */
#enrollmentForm .form-label {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

#enrollmentForm .form-control,
#enrollmentForm .form-select {
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#enrollmentForm .form-control:focus,
#enrollmentForm .form-select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.2rem rgba(255, 204, 0, 0.15);
}

#enrollmentForm .form-control::placeholder {
    color: #adb5bd;
}

#enrollmentForm textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* File Input Styling */
#enrollmentForm input[type="file"]::file-selector-button {
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
    margin-right: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#enrollmentForm input[type="file"]::file-selector-button:hover {
    background-color: var(--secondary);
    border-color: var(--secondary);
}

/* Checkbox Styling */
#enrollmentForm .form-check {
    padding-left: 1.75rem;
}

#enrollmentForm .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    border: 2px solid var(--border-color);
    cursor: pointer;
}

#enrollmentForm .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

#enrollmentForm .form-check-input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.2rem rgba(255, 204, 0, 0.15);
}

#enrollmentForm .form-check-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
}

/* Modal Footer */
#enrollModal .modal-footer {
    background-color: #fff;
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Button Styling */
.btn-cancel {
    background-color: transparent;
    color: var(--text-muted);
    border: 2px solid var(--border-color);
    padding: 0.65rem 2rem;
    font-weight: 600;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background-color: var(--light-bg);
    border-color: var(--text-muted);
    color: var(--primary);
}

.btn-submit {
    background-color: var(--secondary);
    color: var(--primary);
    border: 2px solid var(--secondary);
    padding: 0.65rem 2rem;
    font-weight: 600;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background-color: #ffdb4d;
    border-color: #ffdb4d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 204, 0, 0.3);
}

/* ====================================
   RESPONSIVE DESIGN
   ==================================== */

/* Styles for the accordion view on tablets and mobile (Bootstrap's 'lg' breakpoint) */
@media (max-width: 991.98px) {
    .internship-content-section {
        padding-top: 80px;
    }
    
    /* Remove sticky behavior and height limits on mobile */
    .sidebar-wrapper {
        position: static;
        top: auto;
    }

    .internship-list {
        max-height: none;
        overflow-y: visible;
    }

    /* Allow list items to wrap their content, necessary for the mobile details div */
    .internship-list-item {
        flex-wrap: wrap;
    }

    /* When a list item is active (clicked), display its corresponding details panel */
    .internship-list-item.active + .internship-mobile-details {
        display: block;
    }

    /* Reset the styling of the details content when it's inside the mobile accordion */
    .internship-mobile-details .internship-details-content {
        border: none;
        padding: 0;
        background-color: transparent;
        border-radius: 0;
    }
}


/* Styles specifically for the modal on smaller mobile screens */
@media (max-width: 768px) {
    #enrollModal .modal-dialog {
        margin: 0.5rem;
    }

    #enrollModal .modal-body {
        padding: 1.5rem;
    }

    #enrollModal .modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
    }

    .btn-cancel,
    .btn-submit {
        width: 100%;
    }

    .modal-subtitle {
        font-size: 0.75rem;
    }

    #enrollModal .modal-title {
        font-size: 1.5rem;
    }
}