/*
 * This file contains the complete and corrected CSS styles for the application.
 * It has been updated to include fixes and new features provided by a friend's
 * optimized solution, ensuring no original styles were lost.
 */

/* =======================================
   GENERAL STYLES
   ======================================= */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    color: #343a40;
    line-height: 1.6;
}

/* =======================================
   FORM STYLES
   ======================================= */
.cmo-form-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.cmo-form-title {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 24px;
}

.cmo-form-row {
    margin-bottom: 20px;
}

.cmo-form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.cmo-form-row input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.cmo-form-row input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
}

.cmo-form-actions {
    margin-top: 25px;
    text-align: center;
}

.cmo-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.3s;
}

.cmo-button:hover {
    background: #005a87;
}

/* =======================================
   ALERT STYLES
   ======================================= */
.cmo-alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    text-align: center;
}

.cmo-alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cmo-alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.cmo-alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* =======================================
   DASHBOARD STYLES (NEW)
   ======================================= */
.cmo-logged-in-message {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.cmo-dashboard-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px 15px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.cmo-dashboard-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.cmo-section {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    padding: 25px;
    margin-bottom: 25px;
}

.cmo-section h2 {
    color: #4f46e5;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 22px;
}

.cmo-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.cmo-info-item {
    display: flex;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eee;
}

.cmo-info-label {
    font-weight: 600;
    color: #555;
}

.cmo-info-value {
    color: #333;
    text-align: right;
}

/* =======================================
   BUTTON STYLES (UPDATED)
   ======================================= */
.cmo-form-actions {
    margin-top: 20px;
    text-align: center;
}

.cmo-button {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
    width: auto;
    min-width: 180px;
    margin: 5px;
}

.cmo-button:hover {
    background: #3f38b5;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

.cmo-button-primary {
    background: #10b981;
}

.cmo-button-primary:hover {
    background: #0da271;
}

.cmo-button-secondary {
    background: #6b7280;
}

.cmo-button-secondary:hover {
    background: #5a6268;
}

.cmo-double-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

/* =======================================
   MISCELLANEOUS STYLES (NEW)
   ======================================= */
.cmo-placeholder {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 15px 0;
}

.cmo-features-list {
    text-align: left;
    max-width: 500px;
    margin: 20px auto;
    padding: 0;
    list-style-type: none;
}

.cmo-features-list li {
    padding: 8px 0;
    position: relative;
    padding-left: 25px;
}

.cmo-features-list li:before {
    content: "✓";
    color: #10b981;
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* =======================================
   MODAL STYLES (NEW/UPDATED)
   ======================================= */
.cmo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.cmo-modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.cmo-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.3s;
}

.cmo-modal-close:hover {
    color: #4f46e5;
}

.cmo-modal h3 {
    margin-top: 0;
    color: #4f46e5;
    text-align: center;
    margin-bottom: 25px;
}

/* =======================================
   EDIT PROFILE MODAL SPECIFICS
   ======================================= */
#cmo-edit-profile-form .cmo-form-row {
    margin-bottom: 15px;
}

#cmo-edit-profile-form select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    background-color: white;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

.cmo-input-hint {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

/* =======================================
   INPUT VALIDATION
   ======================================= */
#cmo-edit-profile-form input:invalid {
    border-color: #f8d7da;
}

#cmo-edit-profile-form input:valid {
    border-color: #d4edda;
}

/* =======================================
   RESPONSIVE ADJUSTMENTS
   ======================================= */
@media (max-width: 680px) {
    .cmo-form-container {
        padding: 20px 15px;
        margin: 0 15px;
    }
    .cmo-dashboard-container {
        padding: 15px 10px;
    }
    .cmo-section {
        padding: 20px 15px;
    }
    .cmo-button {
        width: 100%;
        margin: 5px 0;
    }
    .cmo-double-buttons {
        flex-direction: column;
    }
}

@media (max-width: 500px) {
    .cmo-modal-content {
        max-width: 95%;
        padding: 20px 15px;
    }
    #cmo-edit-profile-form .cmo-form-row {
        margin-bottom: 12px;
    }
    #cmo-edit-profile-form input,
    #cmo-edit-profile-form select {
        padding: 10px 12px;
        font-size: 15px;
    }
    .cmo-input-hint {
        font-size: 11px;
    }
    .cmo-form-actions .cmo-button {
        padding: 10px 15px;
        min-width: 100%;
        margin: 8px 0;
    }
}

@media (max-width: 480px) {
    .cmo-dashboard-header h1 {
        font-size: 24px;
    }
    .cmo-intro h2 {
        font-size: 20px;
    }
    .cmo-section h2 {
        font-size: 20px;
    }
    .cmo-modal-content {
        padding: 20px 15px;
    }
    #cmo-edit-profile-form input,
    #cmo-edit-profile-form select {
        font-size: 16px !important;
    }
}

/* ========================================
   THERAPIST PHOTOS & GALLERY FIXES
   ======================================== */

/* Profile photo - round canvas */
.cmo-therapist-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background-color: #f0f0f0;
    pointer-events: none; /* Prevents right-click menu but preserves image visibility */
    -webkit-touch-callout: none; /* iOS: prevent long-press menu */
    -webkit-user-select: none;
    user-select: none;
}

/* Desktop larger size */
@media (min-width: 769px) {
    .cmo-therapist-photo {
        width: 150px;
        height: 150px;
    }
}

/* Photo gallery images */
.cmo-media-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.cmo-media-item {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background-color: #f5f5f5;
}

.cmo-media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none; /* Prevents right-click */
    -webkit-touch-callout: none; /* iOS protection */
    -webkit-user-select: none;
    user-select: none;
}

/* Video container - keep working as is */
.cmo-video-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
}

.cmo-video-item {
    width: 100%;
    max-width: 400px;
}

.cmo-video-container {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.cmo-video-container video {
    width: 100%;
    height: auto;
    display: block;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .cmo-therapist-photo {
        width: 70px;
        height: 70px;
    }
    
    .cmo-media-item {
        width: 80px;
        height: 80px;
    }
}

/* CRITICAL: Prevent JavaScript from hiding images */
.cmo-therapist-photo,
.cmo-media-item img {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    min-width: 50px !important;
    min-height: 50px !important;
}

/* Protection without hiding */
.cmo-therapist-photo {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: auto; /* Keep clickable but prevent save */
}

.cmo-media-item {
    position: relative;
    overflow: hidden;
}

/* Subtle protection overlay that doesn't block visibility */
.cmo-media-item::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
    z-index: 1;
}

/* Ensure images are above any overlays */
.cmo-media-item img {
    position: relative;
    z-index: 2;
}

