/* Clinic Review Pro - Styles */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&display=swap');

/* ── Clinic Header ───────────────────────────────── */
.crp-clinic-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.crp-clinic-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 4px;
    background: white;
    flex-shrink: 0;
}

.crp-clinic-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.crp-clinic-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    font-family: 'Cairo', sans-serif;
}

.crp-clinic-location {
    font-size: 0.85rem;
    color: var(--text-light);
    font-family: 'Cairo', sans-serif;
}

.crp-container {
    --primary: #0066CC;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EC4899;
    --text-dark: #1E293B;
    --text-light: #6B7280;
    --border: #E5E7EB;
    --bg-light: #F0F7FF;
    
    background: linear-gradient(135deg, var(--bg-light) 0%, #FFFFFF 100%);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 102, 204, 0.1);
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-dark);
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Steps */
.crp-step {
    display: none;
    opacity: 0;
    animation: slideIn 0.3s ease forwards;
    width: 100%;
}

.crp-step.active {
    display: block;
    opacity: 1;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.crp-content {
    width: 100%;
}

.crp-step h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--text-dark);
    word-wrap: break-word;
}

.crp-step p {
    font-size: 1rem;
    color: var(--text-light);
    margin: 0 0 1.5rem 0;
    word-wrap: break-word;
}

/* Back Button */
.crp-back-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
    font-size: 0.95rem;
}

.crp-back-btn:hover {
    color: var(--text-dark);
}

/* Buttons Container */
.crp-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* Button Base */
.crp-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
    font-family: 'Cairo', sans-serif;
}

.crp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.crp-btn:active {
    transform: scale(0.98);
}

.crp-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Button Variants */
.crp-btn-positive,
.crp-btn-primary,
.crp-btn-success {
    background: linear-gradient(135deg, var(--primary) 0%, var(--success) 100%);
    color: white;
}

.crp-btn-positive:hover,
.crp-btn-primary:hover,
.crp-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 102, 204, 0.3);
}

.crp-btn-negative {
    background: linear-gradient(135deg, var(--warning) 0%, var(--danger) 100%);
    color: white;
}

.crp-btn-negative:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(245, 158, 11, 0.3);
}

.crp-btn-secondary {
    background: white;
    color: var(--text-dark);
    border: 2px solid var(--border);
}

.crp-btn-secondary:hover {
    border-color: var(--primary);
    background: var(--bg-light);
}

/* Keywords */
.crp-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border);
    max-height: 300px;
    overflow-y: auto;
}

.crp-keyword {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    font-family: 'Cairo', sans-serif;
}

.crp-keyword:hover {
    border-color: var(--primary);
    background: var(--bg-light);
    transform: translateY(-2px);
}

.crp-keyword.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.05);
}

/* Review Box */
.crp-review-box {
    background: linear-gradient(135deg, var(--bg-light) 0%, white 100%);
    border: 2px solid var(--success);
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 150px;
    height: auto;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    margin-bottom: 1.5rem;
    line-height: 1.8;
    font-size: 1rem;
    color: var(--text-dark);
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    word-break: break-word;
    font-family: 'Cairo', sans-serif;
}

.crp-review-box > div {
    width: 100%;
}

.crp-review-box p {
    margin: 0;
    color: var(--text-dark);
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    font-size: 1rem;
    line-height: 1.8;
    font-family: 'Cairo', sans-serif;
}

.crp-review-box p[dir="rtl"],
.crp-review-box p.rtl-text {
    direction: rtl;
    text-align: right;
    unicode-bidi: embed;
}

.crp-review-box p:not([dir="rtl"]):not(.rtl-text) {
    direction: ltr;
    text-align: left;
}

.crp-review-box small {
    font-size: 0.85rem;
    margin-bottom: 10px;
    color: #999;
    display: block;
    width: 100%;
    direction: ltr;
    text-align: left;
    font-family: 'Cairo', sans-serif;
}

/* Error Dialog */
.crp-error-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.crp-error-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.crp-error-content p {
    margin: 0 0 1.5rem 0;
    color: var(--text-dark);
    font-size: 1rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.crp-error-buttons {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

.crp-error-buttons .crp-btn {
    flex: 1;
    min-width: auto;
}

.crp-cancel-btn {
    background: white;
    color: var(--text-dark);
    border: 2px solid var(--border);
}

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

/* Responsive */
@media (max-width: 768px) {
    .crp-container {
        padding: 1.5rem;
        width: 100%;
    }
    
    .crp-step h2 {
        font-size: 1.5rem;
    }
    
    .crp-buttons {
        flex-direction: column;
    }
    
    .crp-btn {
        width: 100%;
        flex: none;
        min-width: auto;
        padding: 0.75rem 1rem;
    }
    
    .crp-review-box {
        padding: 1.25rem;
        min-height: 120px;
    }
    
    .crp-review-box p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

@media (max-width: 480px) {
    .crp-container {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .crp-step h2 {
        font-size: 1.25rem;
    }
    
    .crp-step p {
        font-size: 0.9rem;
    }
    
    .crp-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .crp-error-content {
        margin: 1rem;
        padding: 1.5rem;
        width: auto;
    }
    
    .crp-review-box {
        padding: 1rem;
        min-height: 100px;
    }
    
    .crp-review-box p {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .crp-keyword {
        white-space: normal;
        word-wrap: break-word;
        text-align: center;
    }
}