* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    direction: rtl;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.page.active {
    display: block;
}

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

/* Login Page */
.login-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    margin-top: 50px;
}

.platform-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.platform-logo {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.platform-text h1 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 2em;
}

.platform-text .subtitle {
    text-align: right;
    color: #666;
    line-height: 1.8;
    font-size: 1em;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.feature-card {
    background: linear-gradient(135deg, #f5f7ff 0%, #e8f0ff 100%);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid #e0e8ff;
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.feature-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.feature-card h3 {
    color: #667eea;
    font-size: 1em;
    margin-bottom: 5px;
}

.feature-card p {
    color: #666;
    font-size: 0.85em;
}

.footer-text {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    color: #999;
    font-size: 0.9em;
}

.footer-text p {
    margin: 0;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

.tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.login-form {
    display: none;
}

.login-form.active {
    display: block;
}

.login-form h2 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.login-form input,
.login-form select {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: border 0.3s;
}

.login-form input:focus,
.login-form select:focus {
    outline: none;
    border-color: #667eea;
}

.hint {
    text-align: center;
    color: #999;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    padding: 12px 30px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 10px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

/* Assessment Page */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.doctor-info-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.doctor-avatar-large {
    font-size: 3em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.doctor-info-header h1 {
    color: #667eea;
    font-size: 1.8em;
    margin: 0;
}

.doctor-subtitle {
    color: #666;
    margin: 5px 0 0 0;
    font-size: 1em;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    color: white;
    font-weight: bold;
    margin-bottom: 30px;
}

#questionsContainer {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
    min-height: 300px;
}

.question {
    display: none;
}

.question.active {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.question h2 {
    color: #667eea;
    margin-bottom: 30px;
    font-size: 1.5em;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option {
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.1em;
}

.option:hover {
    border-color: #667eea;
    background: #f5f7ff;
    transform: translateX(-5px);
}

.option.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.navigation-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.navigation-buttons button {
    min-width: 150px;
}

/* Result Page */
.result-box {
    background: white;
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    margin-top: 50px;
    text-align: center;
}

.result-box h1 {
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2.5em;
}

#resultContent {
    margin: 30px 0;
}

.result-icon {
    font-size: 5em;
    margin-bottom: 20px;
}

.result-title {
    font-size: 2em;
    margin-bottom: 15px;
    font-weight: bold;
}

.result-description {
    font-size: 1.2em;
    color: #666;
    line-height: 1.8;
    margin-bottom: 20px;
}

.result-score {
    font-size: 3em;
    font-weight: bold;
    margin: 20px 0;
}

.severity-low { color: #4CAF50; }
.severity-moderate { color: #FF9800; }
.severity-high { color: #f44336; }

.recommendations {
    background: #f5f7ff;
    padding: 25px;
    border-radius: 15px;
    margin-top: 30px;
    text-align: right;
}

.recommendations h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.recommendations ul {
    list-style-position: inside;
    color: #666;
    line-height: 2;
}

.result-box button {
    margin: 10px;
}

/* Doctor Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    color: #666;
    margin-bottom: 15px;
    font-size: 1em;
}

.stat-number {
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
}

.stat-number.critical { color: #f44336; }
.stat-number.moderate { color: #FF9800; }
.stat-number.normal { color: #4CAF50; }

.patients-list {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.patients-list h2 {
    color: #667eea;
    margin-bottom: 25px;
}

.patient-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.patient-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.patient-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.patient-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
}

.severity-badge {
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
}

.severity-badge.low {
    background: #e8f5e9;
    color: #4CAF50;
}

.severity-badge.moderate {
    background: #fff3e0;
    color: #FF9800;
}

.severity-badge.high {
    background: #ffebee;
    color: #f44336;
}

.patient-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    color: #666;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.85em;
    color: #999;
    margin-bottom: 5px;
}

.info-value {
    font-weight: bold;
    color: #333;
}

.patient-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn-action {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.95em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-view {
    background: #e3f2fd;
    color: #1976d2;
}

.btn-view:hover {
    background: #1976d2;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.btn-chat {
    background: #f3e5f5;
    color: #7b1fa2;
}

.btn-chat:hover {
    background: #7b1fa2;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(123, 31, 162, 0.3);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    padding: 20px;
}

.modal.active {
    opacity: 1;
}

.answers-modal {
    background: white;
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.3s ease;
}

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

.answers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.answers-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5em;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.patient-summary {
    padding: 25px 30px;
    background: #f5f7ff;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.patient-summary > div {
    font-size: 0.95em;
    color: #555;
}

.patient-summary strong {
    color: #333;
    display: inline-block;
    min-width: 80px;
}

.answers-list {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.answer-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.answer-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
}

.question-number {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 12px;
}

.question-text {
    font-size: 1.1em;
    color: #333;
    font-weight: 500;
    margin-bottom: 15px;
    line-height: 1.6;
}

.answer-selected {
    background: #f5f7ff;
    padding: 15px;
    border-radius: 10px;
    border-right: 4px solid #667eea;
}

.answer-score {
    float: left;
    background: #667eea;
    color: white;
    padding: 3px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: bold;
}

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

.empty-state-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

/* Doctor Selection Page */
.selection-subtitle {
    text-align: center;
    color: white;
    font-size: 1.2em;
    margin-bottom: 30px;
}

.doctors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.doctor-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: all 0.3s;
    cursor: pointer;
}

.doctor-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.doctor-image {
    font-size: 5em;
    margin-bottom: 15px;
}

.doctor-card h2 {
    color: #667eea;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.doctor-title {
    color: #666;
    font-size: 1.1em;
    font-weight: 500;
    margin-bottom: 20px;
}

.doctor-credentials {
    background: #f5f7ff;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    text-align: right;
}

.doctor-credentials p {
    color: #555;
    margin: 8px 0;
    font-size: 0.95em;
}

.doctor-rating {
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.stars {
    font-size: 1.3em;
}

.rating-text {
    font-size: 1.2em;
    font-weight: bold;
    color: #667eea;
}

.btn-select {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-select:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Description Page */
.description-box {
    background: white;
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    margin-top: 50px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.description-box h1 {
    color: #667eea;
    text-align: center;
    margin-bottom: 15px;
    font-size: 2em;
}

.description-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.description-input-container {
    margin-bottom: 30px;
}

.description-input-container label {
    display: block;
    color: #667eea;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
}

.description-input-container textarea {
    width: 100%;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    transition: border 0.3s;
    line-height: 1.8;
}

.description-input-container textarea:focus {
    outline: none;
    border-color: #667eea;
}

.char-count {
    text-align: left;
    color: #999;
    font-size: 0.9em;
    margin-top: 10px;
}

.description-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.description-actions button {
    min-width: 150px;
}

/* Chat Styles */
.chat-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    margin-top: 20px;
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px 20px 0 0;
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
}

.chat-user-info h3 {
    margin: 0;
    font-size: 1.3em;
}

.chat-status {
    margin: 0;
    font-size: 0.9em;
    opacity: 0.9;
}

.chat-messages {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #f5f7ff;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-welcome {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.chat-welcome h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.message {
    max-width: 70%;
    padding: 15px 20px;
    border-radius: 18px;
    word-wrap: break-word;
    animation: messageSlide 0.3s ease;
}

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

.message.sent {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    align-self: flex-end;
    border-radius: 18px 18px 5px 18px;
}

.message.received {
    background: white;
    color: #333;
    align-self: flex-start;
    border-radius: 18px 18px 18px 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.message-time {
    font-size: 0.75em;
    opacity: 0.7;
    margin-top: 5px;
    display: block;
}

.message.sent .message-time {
    text-align: left;
}

.message.received .message-time {
    text-align: right;
}

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 15px 20px;
    background: white;
    border-radius: 18px;
    width: fit-content;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.chat-input-container {
    display: flex;
    gap: 10px;
    padding: 20px 30px;
    background: white;
    border-top: 2px solid #f0f0f0;
    border-radius: 0 0 20px 20px;
}

#chatInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1em;
    transition: border 0.3s;
}

#chatInput:focus {
    outline: none;
    border-color: #667eea;
}

.btn-send {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.send-icon {
    font-size: 1.2em;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .login-box,
    .result-box {
        padding: 25px;
        margin-top: 20px;
    }
    
    .platform-header {
        flex-direction: column;
        text-align: center;
    }
    
    .platform-logo {
        width: 80px;
        height: 80px;
    }
    
    .platform-text h1 {
        font-size: 1.5em;
    }
    
    .features-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .feature-card {
        padding: 15px;
    }
    
    .feature-icon {
        font-size: 2em;
    }
    
    .feature-card h3 {
        font-size: 0.9em;
    }
    
    .feature-card p {
        font-size: 0.75em;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .doctor-info-header {
        flex-direction: column;
    }
    
    .doctor-info-header h1 {
        font-size: 1.3em;
    }
    
    #questionsContainer {
        padding: 25px;
    }
    
    .navigation-buttons {
        flex-direction: column;
    }
    
    .navigation-buttons button {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .chat-container {
        height: calc(100vh - 50px);
        margin-top: 10px;
    }

    .message {
        max-width: 85%;
    }

    .chat-header {
        padding: 15px 20px;
    }

    .chat-messages {
        padding: 20px;
    }

    .chat-input-container {
        padding: 15px 20px;
    }

    .btn-send span:first-child {
        display: none;
    }
    
    .doctors-grid {
        grid-template-columns: 1fr;
    }
    
    .description-box {
        padding: 30px 20px;
        margin-top: 20px;
    }
    
    .description-box h1 {
        font-size: 1.5em;
    }
    
    .description-actions {
        flex-direction: column;
    }
    
    .description-actions button {
        width: 100%;
    }
}
