/**
 * Sessions Dashboard Styles
 * Styles for the patient session history in the doctor dashboard
 */

/* Sessions Controls */
.sessions-controls {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sessions-controls .form-group {
    margin-bottom: 0;
    flex-grow: 1;
}

.sessions-controls select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
}

.sessions-controls button {
    padding: 10px 20px !important;
    background-color: #0073aa !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    transition: background-color 0.2s ease;
}

.sessions-controls button:hover {
    background-color: #005177 !important;
}

.sessions-controls button:disabled {
    background-color: #ccc !important;
    cursor: not-allowed !important;
}

/* Sessions List */
.sessions-list-container {
    margin-bottom: 40px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 20px;
}

.sessions-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 15px;
    border-radius: 6px;
    overflow: hidden;
}

.sessions-table th,
.sessions-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.sessions-table th {
    background-color: #f0f7ff;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

.sessions-table tr:last-child td {
    border-bottom: none;
}

.sessions-table tr:hover {
    background-color: #f9f9f9;
}

.view-session-btn {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.view-session-btn:hover {
    background-color: #005177;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Session Details */
.session-details-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 25px;
    margin-top: 30px;
}

#session-details-title {
    margin-top: 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f7ff;
    color: #0073aa;
    font-size: 1.4em;
}

.session-details-content {
    margin-bottom: 30px;
}

.session-info {
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

#session-details-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

#session-details-info p {
    margin: 8px 0;
}

#session-details-info strong {
    color: #555;
}

/* Session Images */
.session-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0 30px;
}

.session-image {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.session-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.session-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Session Details */
.session-details {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0 30px;
    border-left: 4px solid #0073aa;
}

.session-details h6 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #0073aa;
    font-size: 1.1em;
}

.session-details ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.session-details li {
    padding: 10px 15px;
    margin-bottom: 8px;
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session-details li.identified {
    color: #46b450;
    border-left: 3px solid #46b450;
}

.session-details li.not-identified {
    color: #999;
    border-left: 3px solid #ddd;
}

.session-details .dashicons-yes {
    color: #46b450;
    font-size: 1.2em;
}

/* Iframe Styles */
.interactive-system-container,
.gradio-container {
    width: 100%;
    margin: 20px 0;
    border-radius: 8px;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background-color: white;
}

.iframe-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.interactive-system-container iframe,
.gradio-container iframe,
iframe.gradio-iframe {
    display: block;
    width: 100%;
    border: none;
    background-color: white;
    transition: height 0.5s ease;
    overflow: hidden;
}

/* Loading and Error States */
.loading {
    color: #0073aa;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.error {
    color: #dc3232;
    font-weight: bold;
    padding: 20px;
    text-align: center;
    background-color: #fef8f8;
    border-radius: 6px;
    border-left: 4px solid #dc3232;
}

/* Back Button */
#back-to-sessions-btn {
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    color: #555;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

#back-to-sessions-btn:hover {
    background-color: #eee;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#back-to-sessions-btn:before {
    content: "←";
    margin-right: 8px;
    font-weight: bold;
}

/* Chat Messages */
.session-chat {
    margin: 30px 0;
}

.session-chat h6 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #0073aa;
    font-size: 1.1em;
}

.chat-messages {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.chat-message {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.chat-message:last-child {
    border-bottom: none;
}

.chat-message.system {
    background-color: #f0f7ff;
}

.chat-message.patient {
    background-color: #f9f9f9;
}

.message-header {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.message-content {
    line-height: 1.5;
}

/* Responsive Adjustments */
@media screen and (max-width: 782px) {
    .sessions-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sessions-table th,
    .sessions-table td {
        padding: 10px 8px;
    }
    
    .session-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .session-info {
        grid-template-columns: 1fr;
    }
}
