/* MedicaDoma - Professional Medical Consultation Platform */
/* Author: Professional Development Team */
/* Description: Main stylesheet for medical consultation payment and chat interface */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container Styles */
.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    max-width: 500px;
    width: 100%;
}

.container.chat-mode {
    max-width: 98vw;
    width: 98vw;
    max-height: 95vh;
    height: 95vh;
    padding: 0;
    margin: 1vh 1vw;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    background: white;
}

/* Full monitor mode for PC users */
.container.chat-mode.fullscreen {
    max-width: 100vw;
    width: 100vw;
    max-height: 100vh;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

/* Mobile responsive adjustments for chat mode */
@media (max-width: 768px) {
    .container.chat-mode {
        max-width: 100vw;
        width: 100vw;
        max-height: 100vh;
        height: 100vh;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }
    
    .chat-header {
        border-radius: 0;
        padding: 16px 20px;
    }
    
    .chat-container {
        border-radius: 0;
        padding: 16px;
    }
    
    .chat-container iframe {
        border-radius: 8px;
        min-height: calc(100vh - 140px);
    }
}

/* Logo and Branding */
.logo {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.logo h1 {
    color: #333;
    font-size: 32px;
    margin-bottom: 10px;
}

.logo p {
    color: #666;
    font-size: 16px;
}

/* Consultation Card */
.consultation-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.price-tag {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.price {
    font-size: 36px;
    color: #667eea;
    font-weight: bold;
}

.price-info {
    text-align: right;
}

.price-label {
    color: #999;
    font-size: 14px;
}

/* Features List */
.features {
    list-style: none;
    margin: 20px 0;
}

.features li {
    padding: 10px 0;
    color: #555;
    display: flex;
    align-items: center;
}

.features li:before {
    content: "✓";
    color: #4caf50;
    font-weight: bold;
    margin-right: 10px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    color: #333;
    font-weight: 500;
    margin-bottom: 8px;
}

input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

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

#card-element {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
}

#card-errors {
    color: #dc3545;
    margin-top: 10px;
    font-size: 14px;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Status Messages */
.status-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    display: none;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Consultation Link */
.consultation-link {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: #e8f5e9;
    border-radius: 8px;
    text-align: center;
}

.consultation-link a {
    display: inline-block;
    padding: 12px 30px;
    background: #4caf50;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 10px;
}

.consultation-link a:hover {
    background: #45a049;
}

/* Section Management */
#payment-section {
    display: block;
}

#success-section {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

/* Success Page Elements */
.success-icon {
    font-size: 60px;
    color: #4caf50;
    margin-bottom: 20px;
}

.success-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
}

.success-message {
    color: #666;
    margin-bottom: 30px;
}

/* Chat Interface Styles */
#chat-section {
    display: none;
    padding: 0;
    flex: 1;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

#chat-section.active {
    display: flex;
    animation: fadeInChat 0.3s ease-out;
}

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

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 32px;
    margin: 0 20px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
    position: relative;
    z-index: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Fullscreen mode - hide header completely */
.container.chat-mode.fullscreen .chat-header {
    display: none;
}

/* Fullscreen toggle button */
.fullscreen-toggle {
    position: absolute;
    top: 16px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.fullscreen-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.chat-header h2 {
    margin: 0;
    font-size: 24px;
}

.chat-header p {
    margin: 5px 0 0 0;
    opacity: 0.9;
}

/* Header Elements */
.header-disclaimer {
    margin-top: 12px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    color: white !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    line-height: 1.4;
}

.session-timer {
    margin-top: 12px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    color: white !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    line-height: 1.4;
}

.timer-icon {
    color: #28a745 !important;
    font-size: 16px;
    font-weight: bold;
}


/* Timer States */
.session-timer.warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ff6b35;
}

.session-timer.critical {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Chat Container */
.chat-container {
    background: #f8f9fa;
    border-radius: 0 0 20px 20px;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: relative;
}

/* Fullscreen mode chat container */
.container.chat-mode.fullscreen .chat-container {
    border-radius: 0;
    padding: 0;
    position: relative;
}

/* Ensure arrows stay visible in fullscreen mode */
.container.chat-mode.fullscreen .fullscreen-arrows {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 9999;
}

/* Remove the exit overlay button - using only arrow controls */
.fullscreen-exit-overlay {
    display: none !important;
}

/* Remove iframe styling in fullscreen */
.container.chat-mode.fullscreen #mindstudio-iframe {
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Fullscreen arrow controls */
.fullscreen-arrows {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 999;
    display: flex;
    gap: 12px;
}

.fullscreen-arrow {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.25);
    position: relative;
    overflow: hidden;
}

.fullscreen-arrow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.fullscreen-arrow:hover::before {
    left: 100%;
}

.fullscreen-arrow:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
}

.fullscreen-arrow:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.fullscreen-arrow.expand {
    font-size: 16px;
}

.fullscreen-arrow.compress {
    font-size: 20px;
}

/* Hide compress arrow in normal mode, show expand */
.fullscreen-arrow.compress {
    display: none;
}

/* In fullscreen mode, show compress arrow, hide expand */
.container.chat-mode.fullscreen .fullscreen-arrow.expand {
    display: none;
}

.container.chat-mode.fullscreen .fullscreen-arrow.compress {
    display: flex;
}

/* Hide the old fullscreen toggle in header when we have arrows */
.container.chat-mode .fullscreen-toggle {
    display: none;
}

.chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,0.1), transparent);
}

/* Medical Disclaimer */
.medical-disclaimer {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    font-size: 13px;
    line-height: 1.4;
    color: #c53030;
}

.medical-disclaimer h4 {
    color: #e53e3e;
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.medical-disclaimer p {
    margin: 0;
}