/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3B82F6;
    --primary-dark: #2563EB;
    --secondary-color: #64748B;
    --accent-color: #10B981;
    --background-light: #F8FAFC;
    --background-white: #FFFFFF;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --border-color: #E2E8F0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background-light);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 2rem;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 8rem);
}

/* Left Panel - Information */
.info-panel {
    background: var(--background-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.info-content {
    max-width: 100%;
}

.app-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    margin: 0 auto 1rem;
    width: 40px;
    height: 40px;
}

.app-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.app-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.services-section {
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.service-card {
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.service-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.service-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.interaction-guide {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: var(--radius-md);
    padding: 1.5rem;
    color: white;
}

.guide-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.guide-list {
    list-style: none;
}

.guide-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.guide-item:last-child {
    margin-bottom: 0;
}

.guide-icon {
    font-size: 1.1rem;
}

/* Feedback Section - now at top of right panel */
.feedback-section-top {
    background: linear-gradient(135deg, var(--accent-color), #059669);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    color: white;
    margin-bottom: 1.5rem;
}

/* Legacy feedback section (now unused) */
.feedback-section {
    background: linear-gradient(135deg, var(--accent-color), #059669);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    color: white;
    margin-top: 1.5rem;
}

.feedback-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feedback-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    opacity: 0.95;
}

.form-input {
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.form-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.checkbox-group {
    margin: 0.5rem 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1.4;
}

.form-checkbox {
    margin-top: 0.1rem;
    width: 1rem;
    height: 1rem;
    accent-color: white;
}

.checkbox-text {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.submit-btn,
.meeting-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    flex: 1;
    justify-content: center;
}

.submit-btn {
    background: white;
    color: var(--accent-color);
    border: none;
    cursor: pointer;
}

.submit-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.meeting-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.meeting-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 0.9rem;
}

.form-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.status-message {
    font-size: 0.85rem;
    margin: 0;
}

.form-status.loading {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
}

.form-status.success {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
}

.form-status.error {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

/* Right Panel - Widget Area */

.widget-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.widget-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.widget-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.widget-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Compact widget header */
.widget-header-compact {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.widget-title-compact {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.widget-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 450px;
    background: var(--background-light);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-color);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* Create a stacking context to contain the widget */
.widget-panel {
    background: var(--background-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 600px;
    isolation: isolate;
    z-index: 1;
}

/* Widget always fills available space */
.widget-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Widget fills the entire wrapper */
elevenlabs-convai {
    width: 100% !important;
    height: 100% !important;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative !important;
    display: block !important;
}

/* Footer */
.app-footer {
    background: var(--background-white);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Hide mobile help text on desktop */
@media (min-width: 769px) {
    .widget-subtitle {
        display: none !important;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .info-panel {
        position: static;
        order: 2;
    }
    
    .widget-panel {
        order: 1;
        min-height: 500px;
    }
    
    .main-content {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .content-grid {
        gap: 1.5rem;
    }
    
    .info-panel,
    .widget-panel {
        padding: 1.5rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .app-title {
        font-size: 1.75rem;
    }
    
    .widget-panel {
        min-height: auto;
    }
    
    .widget-wrapper {
        min-height: 400px;
        position: relative;
    }
    
    /* Mobile fullscreen toggle button */
    .mobile-fullscreen-toggle {
        position: absolute;
        top: 10px;
        right: 10px;
        background: rgba(59, 130, 246, 0.95);
        color: white;
        border: none;
        border-radius: var(--radius-md);
        padding: 0.75rem;
        font-size: 1.5rem;
        font-weight: bold;
        cursor: pointer;
        z-index: 20;
        box-shadow: var(--shadow-lg);
        transition: all 0.2s ease;
        display: none;
        min-width: 48px;
        min-height: 48px;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-fullscreen-toggle:hover,
    .mobile-fullscreen-toggle:active {
        background: rgba(59, 130, 246, 1);
        transform: scale(1.1);
        box-shadow: var(--shadow-lg);
    }
    
    /* Show fullscreen button only on mobile */
    .mobile-fullscreen-toggle.show {
        display: flex;
    }
    
    /* Fullscreen widget overlay */
    .widget-fullscreen-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--background-white);
        z-index: 1000;
        display: none;
        flex-direction: column;
    }
    
    .widget-fullscreen-overlay.active {
        display: flex;
    }
    
    .fullscreen-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
        background: var(--background-white);
        position: relative;
    }
    
    .fullscreen-header::before {
        content: '';
        position: absolute;
        top: 0.5rem;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: var(--border-color);
        border-radius: 2px;
    }
    
    .fullscreen-header::after {
        content: 'Swipe ned eller dobbelttrykk for å lukke';
        position: absolute;
        top: -0.5rem;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.75rem;
        color: var(--text-muted);
        background: var(--background-white);
        padding: 0 0.5rem;
        white-space: nowrap;
    }
    
    .fullscreen-title {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text-primary);
        margin: 0;
    }
    
    .fullscreen-close {
        background: var(--primary-color);
        color: white;
        border: none;
        border-radius: var(--radius-sm);
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        min-height: 44px; /* iOS recommended touch target size */
        transition: all 0.2s ease;
    }
    
    .fullscreen-close:hover,
    .fullscreen-close:active {
        background: var(--primary-dark);
        transform: scale(1.02);
    }
    
    .fullscreen-widget-container {
        flex: 1;
        padding: 0.25rem;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        min-height: 0;
    }
    
    /* Mobile fullscreen container adjustments */
    @media (max-width: 768px) {
        .fullscreen-widget-container {
            padding: 0.5rem;
        }
    }
    
    .fullscreen-widget-wrapper {
        flex: 1;
        border-radius: var(--radius-md);
        overflow: visible;
        background: var(--background-light);
        position: relative;
        width: 100%;
        height: 100%;
        min-height: 400px;
    }
    
    /* Mobile fullscreen wrapper adjustments */
    @media (max-width: 768px) {
        .fullscreen-widget-wrapper {
            overflow: visible;
            min-height: 300px;
        }
    }
    
    /* Fullscreen widget fills entire space */
    .fullscreen-widget-wrapper elevenlabs-convai {
        width: 100% !important;
        height: 100% !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        margin: 0 !important;
        max-width: none !important;
        max-height: none !important;
        transform: none !important;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0.75rem;
    }
    
    .info-panel,
    .widget-panel {
        padding: 1rem;
        border-radius: var(--radius-md);
    }
    
    .app-title {
        font-size: 1.5rem;
    }
    
    .service-card {
        padding: 1rem;
    }
    
    .interaction-guide {
        padding: 1rem;
    }
    
    .feedback-section,
    .feedback-section-top {
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .submit-btn,
    .meeting-btn {
        flex: none;
    }
    
    .widget-wrapper {
        min-height: 250px;
    }
    
    /* Shorter hint text on small screens */
    .fullscreen-header::after {
        content: 'Swipe ned for å lukke';
        font-size: 0.7rem;
    }
}

/* Loading and interaction states */
.widget-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

.widget-wrapper.loaded::before {
    display: none;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
} 