/**
 * Build Your Program - Styles
 */

/* Main Container */
#byp-program-builder {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Selection Status Bar */
.byp-selection-status {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.byp-selection-count {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.byp-selection-count .count-number {
    color: #007cba;
    font-size: 24px;
    margin-right: 5px;
}

/* Search Section */
.byp-search-section {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.byp-search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.byp-search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.byp-search-btn,
.byp-clear-search {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.byp-search-btn {
    background: #007cba;
    color: white;
}

.byp-search-btn:hover {
    background: #005a87;
}

.byp-clear-search {
    background: #6c757d;
    color: white;
}

.byp-clear-search:hover {
    background: #545b62;
}

/* Filters */
.byp-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.byp-filter-item label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

.byp-filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

/* Results Section */
.byp-results-section {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
}

.byp-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e5e5;
}

.byp-results-count {
    font-size: 14px;
    color: #666;
}

/* Results Table */
.byp-results-table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

.byp-results-table {
    width: 100%;
    border-collapse: collapse;
}

.byp-results-table thead {
    background: #f8f9fa;
}

.byp-results-table th {
    padding: 12px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

.byp-results-table tbody tr {
    border-bottom: 1px solid #e5e5e5;
    transition: background-color 0.2s ease;
}

.byp-results-table tbody tr:hover {
    background: #f8f9fa;
}

.byp-results-table td {
    padding: 12px;
    font-size: 14px;
    color: #333;
    vertical-align: middle;
}

.byp-course-title {
    font-weight: 500;
    color: #007cba;
}

.byp-certification-indicator {
    display: inline-block;
    background: #ffc107;
    color: #333;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* Action Buttons */
.byp-view-instructors,
.byp-add-course,
.byp-remove-course-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 2px;
}

.byp-view-instructors {
    background: #6c757d;
    color: white;
}

.byp-view-instructors:hover {
    background: #545b62;
}

.byp-add-course {
    background: #28a745;
    color: white;
}

.byp-add-course:hover {
    background: #218838;
}

.byp-add-course.selected {
    background: #dc3545;
}

.byp-add-course.selected:hover {
    background: #c82333;
}

.byp-remove-course-btn {
    background: #dc3545;
    color: white;
}

.byp-remove-course-btn:hover {
    background: #c82333;
}

/* Finalize Buttons */
.byp-finalize-btn {
    background: #007cba;
    color: white;
    padding: 10px 25px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.byp-finalize-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.byp-bottom-actions {
    margin-top: 20px;
    text-align: center;
}

/* Modals */
.byp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.byp-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: auto;
    position: relative;
}

.byp-modal-large {
    max-width: 900px;
}

.byp-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.byp-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.byp-modal-close {
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.byp-modal-close:hover {
    color: #333;
}

.byp-modal-body {
    padding: 20px;
}

/* Instructor List */
.byp-instructor-item {
    padding: 10px 0;
    border-bottom: 1px solid #e5e5e5;
}

.byp-instructor-item:last-child {
    border-bottom: none;
}

.byp-instructor-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.byp-instructor-bio-link {
    color: #007cba;
    text-decoration: none;
    font-size: 13px;
}

.byp-instructor-bio-link:hover {
    text-decoration: underline;
}

/* Finalize Form */
.byp-selected-courses-review {
    margin-bottom: 30px;
}

.byp-selected-courses-review h4 {
    margin-bottom: 15px;
    color: #333;
}

.byp-course-review-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 10px;
}

.byp-course-review-number {
    width: 30px;
    height: 30px;
    background: #007cba;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 15px;
}

.byp-course-review-details {
    flex: 1;
}

.byp-course-review-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.byp-course-review-meta {
    font-size: 13px;
    color: #666;
}

.byp-certification-badge {
    display: inline-block;
    background: #ffc107;
    color: #333;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.byp-remove-course {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.byp-remove-course:hover {
    background: #c82333;
}

/* User Form */
.byp-user-form h4 {
    margin-bottom: 20px;
    color: #333;
}

.byp-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .byp-form-row {
        grid-template-columns: 1fr;
    }
}

.byp-form-field label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.byp-form-field .required {
    color: #dc3545;
}

.byp-form-field input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.byp-form-field input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0,124,186,0.1);
}

.byp-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
}

.byp-cancel-btn,
.byp-submit-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.byp-cancel-btn {
    background: #6c757d;
    color: white;
}

.byp-cancel-btn:hover {
    background: #545b62;
}

.byp-submit-btn {
    background: #28a745;
    color: white;
}

.byp-submit-btn:hover {
    background: #218838;
}

/* Loading States */
.byp-loading,
.byp-form-loading {
    text-align: center;
    padding: 40px;
}

.byp-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Results */
.byp-no-results {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Pagination */
.byp-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
}

.byp-pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.byp-pagination button:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #007cba;
}

.byp-pagination button.active {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.byp-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.byp-page-info {
    margin: 0 10px;
    color: #666;
    font-size: 14px;
}

/* Success Message */
.byp-success-message {
    text-align: center;
    padding: 20px;
}

.byp-success-message p {
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
}

.byp-pdf-link a {
    display: inline-block;
    background: #007cba;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    margin-top: 10px;
}

.byp-pdf-link a:hover {
    background: #005a87;
}

/* Responsive Design */
@media (max-width: 768px) {
    .byp-filter-row {
        grid-template-columns: 1fr;
    }
    
    .byp-search-bar {
        flex-direction: column;
    }
    
    .byp-results-table {
        font-size: 12px;
    }
    
    .byp-results-table th,
    .byp-results-table td {
        padding: 8px;
    }
    
    .byp-selection-status {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}
