/**
 * Skills Instance Selection Styles
 */

.skills-instance-selection-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Schedule Card Checkbox */
.schedules_card {
    position: relative;
}

.schedules_card_checkbox {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.schedules_card_checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #6366f1;
}

.schedules_card.active {
    border-color: #6366f1 !important;
    background-color: #f0f0ff !important;
}

/* Selected Instances List */
.selected-instances-list {
    margin-top: 15px;
}

.selected-instance-item {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    position: relative;
}

.selected-instance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.selected-instance-header strong {
    color: #333;
    font-size: 14px;
}

.remove-instance {
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    line-height: 24px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.remove-instance:hover {
    background: #cc0000;
}

.selected-instance-item p {
    margin: 3px 0;
    color: #666;
    font-size: 13px;
}

.selected-summary {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #e0e0e0;
}

.selected-summary p {
    font-size: 16px;
    color: #333;
}

.trainer_details .hint {
    color: #999;
    font-size: 14px;
    margin-top: 10px;
}

.instance-selection-wrapper {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: start;
}

/* Instances List */
.instances-list {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
}

.instances-list h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
}

.instances-list>p {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

.instances-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

/* Instance Card */
.instance-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.instance-card:hover {
    border-color: #5a6c7d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.instance-card.selected {
    border-color: #5a6c7d;
    background: #f0f3f7;
    box-shadow: 0 4px 12px rgba(90, 108, 125, 0.2);
}

.instance-header {
    margin-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.instance-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.instance-info {
    font-size: 13px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 5px 0;
}

.info-row .label {
    font-weight: 600;
    color: #666;
    min-width: 100px;
}

.info-row .value {
    color: #333;
    text-align: right;
    flex: 1;
}

.info-row .value.price {
    font-weight: 600;
    color: #5a6c7d;
}

.info-row a {
    color: #0066cc;
    text-decoration: none;
}

.info-row a:hover {
    text-decoration: underline;
}

/* Selected Program Panel */
.selected-program {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    position: sticky;
    top: 20px;
}

.selected-program h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #5a6c7d;
    padding-bottom: 10px;
}

.selected-instance-details {
    min-height: 100px;
    margin-bottom: 20px;
}

.program-details {
    font-size: 13px;
}

.program-details h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #333;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 5px 0;
}

.detail-row .label {
    font-weight: 600;
    color: #666;
    min-width: 80px;
}

.detail-row .value {
    color: #333;
    text-align: right;
    flex: 1;
}

.detail-row .value.price {
    font-weight: 600;
    color: #5a6c7d;
}

.detail-row a {
    color: #0066cc;
    text-decoration: none;
}

.detail-row a:hover {
    text-decoration: underline;
}

/* Seat Selection */
.seat-selection {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.seat-selection h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #333;
}

.seat-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.seat-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    color: #5a6c7d;
    transition: all 0.2s ease;
}

.seat-btn:hover {
    background: #5a6c7d;
    color: white;
    border-color: #5a6c7d;
}

#seat-count {
    width: 60px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.seat-info {
    margin: 0;
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #5a6c7d;
    color: white;
}

.btn-primary:hover {
    background: #4a5a6d;
    box-shadow: 0 2px 8px rgba(90, 108, 125, 0.3);
}

.btn-primary:active {
    transform: translateY(1px);
}

/* Login Required Message */
.login-required-message {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.login-required-message h2 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #333;
}

.login-required-message>p {
    font-size: 16px;
    color: #666;
    margin-bottom: 40px;
}

.login-register-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

.login-register-options .option {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.login-register-options .option h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.login-register-options .option p {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.login-register-options .btn {
    margin-bottom: 10px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    width: 100%;
}

.login-register-options .btn-primary {
    background: #5a6c7d;
    color: white;
}

.login-register-options .btn-primary:hover {
    background: #4a5a6d;
    box-shadow: 0 2px 8px rgba(90, 108, 125, 0.3);
}

.login-register-options .btn-secondary {
    background: #e8eef5;
    color: #5a6c7d;
    border: 1px solid #5a6c7d;
}

.login-register-options .btn-secondary:hover {
    background: #d8dff5;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.error {
    color: #d32f2f;
    padding: 15px;
    background: #ffebee;
    border-radius: 4px;
    text-align: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .instance-selection-wrapper {
        grid-template-columns: 1fr;
    }

    .selected-program {
        position: static;
    }

    .instances-grid {
        grid-template-columns: 1fr;
    }

    .login-register-options {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .instances-list {
        padding: 20px;
    }

    .instance-card {
        padding: 12px;
    }

    .info-row {
        flex-direction: column;
        gap: 5px;
    }

    .info-row .label {
        min-width: auto;
    }

    .info-row .value {
        text-align: left;
    }

    .detail-row {
        flex-direction: column;
        gap: 5px;
    }

    .detail-row .label {
        min-width: auto;
    }

    .detail-row .value {
        text-align: left;
    }

    .login-required-message {
        padding: 20px;
    }

    .login-required-message h2 {
        font-size: 22px;
    }

    .login-register-options {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .login-register-options .option {
        padding: 15px;
    }
}

/* NEW COURSE SECTION STYLES */

/* Course Section */
.course-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.course-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.course-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

.course-header h3 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
}

/* Variations List */
.variations-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Variation Card */
.variation-card {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.variation-card:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.variation-info {
    margin-bottom: 15px;
    flex: 1;
}

.variation-card .info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.variation-card .info-row .label {
    font-weight: 600;
    color: #555;
    min-width: 100px;
}

.variation-card .info-row .value {
    color: #333;
    text-align: right;
    flex: 1;
}

.variation-card .info-row .value.price {
    color: #28a745;
    font-weight: 600;
}

.variation-card .info-row a {
    color: #007bff;
    text-decoration: none;
}

.variation-card .info-row a:hover {
    text-decoration: underline;
}

.add-to-cart-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
}

.add-to-cart-btn:hover {
    background-color: #0056b3;
    box-shadow: 0 2px 8px rgba(0, 86, 179, 0.3);
}

.add-to-cart-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.65;
}

/* Multi-Select Styles */
.instance-checkbox {
    flex-shrink: 0;
    padding-top: 5px;
}

.instance-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.instance-info {
    flex: 1;
}

/* Selected Instances Sidebar */
#selected-instances-sidebar {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.sidebar-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.sidebar-empty p {
    margin: 10px 0;
}

.sidebar-empty .hint {
    font-size: 12px;
    color: #bbb;
}

.selected-instances-list {
    margin-bottom: 20px;
}

.selected-instance-item {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.selected-instance-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.selected-instance-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
    flex: 1;
}

.remove-instance {
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    transition: background 0.3s;
}

.remove-instance:hover {
    background: #cc0000;
}

.selected-instance-details p {
    margin: 5px 0;
    font-size: 13px;
    color: #666;
}

.sidebar-summary {
    border-top: 2px solid #e0e0e0;
    padding-top: 15px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.summary-row.total {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

#confirm-and-continue {
    width: 100%;
    padding: 15px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 15px;
}

#confirm-and-continue:hover {
    background: #005a87;
}

#confirm-and-continue:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.course-section {
    margin-bottom: 30px;
}

.course-header {
    background: #0073aa;
    color: white;
    padding: 15px 20px;
    border-radius: 6px 6px 0 0;
    margin-bottom: 0;
}

.course-header h3 {
    margin: 0;
    font-size: 20px;
}

.instances-list {
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 15px;
}

@media (max-width: 768px) {
    .course-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .course-image {
        width: 80px;
        height: 80px;
    }

    .variations-list {
        grid-template-columns: 1fr;
    }

    .instance-selection-wrapper {
        grid-template-columns: 1fr;
    }

    #selected-instances-sidebar {
        position: static;
        max-height: none;
    }
}