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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.top-navigation {
    background: white;
    padding: 15px 30px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    text-decoration: none;
    color: #667eea;
    transition: color 0.3s ease;
}

.nav-brand a:hover {
    color: #5a67d8;
}

.nav-brand h2 {
    color: inherit;
    margin: 0;
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
    align-items: center;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-item a.nav-link {
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-item a.nav-link:hover {
    background: #f7fafc;
    color: #667eea;
}

.nav-item.active a.nav-link {
    background: #667eea;
    color: white;
}

/* Dropdown Styles */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: #4a5568;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-toggle svg {
    display: block;
}

.dropdown-toggle:hover {
    background: #f7fafc;
    color: #667eea;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-link {
    display: block;
    padding: 8px 16px;
    color: #4a5568;
    text-decoration: none;
    transition: background-color 0.2s ease;
    font-size: 14px;
}

.dropdown-link:hover {
    background: #f7fafc;
    color: #667eea;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    color: #2d3748;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #a0aec0;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f7fafc;
    color: #4a5568;
}

.modal-body {
    padding: 0 24px 24px;
}

.feature-section {
    margin-bottom: 20px;
}

.feature-section h3 {
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.feature-section p {
    color: #4a5568;
    margin: 0;
    line-height: 1.5;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 350px 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.control-panel {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.context-section h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #444;
}

.context-input {
    margin-bottom: 15px;
}

.context-input label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.context-input textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
}

.context-input textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    /* Add these new properties */
    vertical-align: top;
    box-sizing: border-box;
    min-height: 44px;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c53030;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(229, 62, 62, 0.3);
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #4a5568;
}

.btn-save {
    background: #27ae60;
    color: white;
    margin-top: 10px;
    padding: 8px 20px;
    font-size: 14px;
}

.btn-save:hover:not(:disabled) {
    background: #219a52;
}

.cv-status {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    display: none;
}

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

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

.recording-controls {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.recording-controls .btn {
    width: 100%;
    margin-bottom: 10px;
}

.recording-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f7fafc;
    border-radius: 5px;
    margin-top: 10px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e0;
    transition: background 0.3s ease;
}

.recording-status.active .status-dot {
    background: #e53e3e;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(229, 62, 62, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(229, 62, 62, 0);
    }
}

.conversation-panel,
.suggestions-panel {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.conversation-panel h2,
.suggestions-panel h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #444;
}

.suggestion-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.suggestion-tab {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    color: #718096;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.suggestion-tab:hover {
    color: #4a5568;
}

.suggestion-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}


.transcript-container,
.suggestions-container,
.live-words-container {
    flex: 1;
    overflow-y: auto;
    max-height: 500px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 5px;
}

.transcript-placeholder,
.suggestion-placeholder,
.live-words-placeholder {
    color: #a0aec0;
    text-align: center;
    padding: 40px 20px;
}

.transcript-entry {
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.transcript-entry.question {
    border-left: 3px solid #667eea;
    background: #f7fafc;
}

.transcript-entry.response {
    border-left: 3px solid #48bb78;
    background: #f0fff4;
}

.transcript-entry.discussion {
    border-left: 3px solid #ed8936;
    background: #fffaf0;
}

.transcript-entry.reading {
    border-left: 3px solid #9f7aea;
    background: #faf5ff;
}

.transcript-entry.analyzing {
    border-left: 3px solid #a0aec0;
    background: #f7fafc;
    opacity: 0.8;
}

.transcript-entry.analyzing .entry-label {
    color: #718096;
    font-style: italic;
}

.transcript-entry .entry-label {
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
    color: #2d3748;
    font-size: 0.9rem;
}

.transcript-entry .text {
    display: block;
    color: #4a5568;
    margin-bottom: 5px;
}

.transcript-entry .timestamp,
.suggestion-entry .timestamp {
    font-size: 0.8rem;
    color: #a0aec0;
}

.suggestion-entry {
    padding: 15px;
    background: #edf2f7;
    border-radius: 5px;
    margin-bottom: 15px;
    border-left: 3px solid #667eea;
}

.suggestion-header {
    margin-bottom: 10px;
    color: #2d3748;
}

.suggestion-text {
    color: #4a5568;
    line-height: 1.8;
    white-space: pre-wrap;
}

.current-suggestion {
    border-left: 3px solid #667eea;
    background: #f7fafc;
}

.history-suggestion {
    border-left: 3px solid #a0aec0;
    background: #edf2f7;
    opacity: 0.9;
}

.history-suggestion .suggestion-header {
    color: #718096;
}

/* Collapsible suggestion styles */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 10px;
    transition: background-color 0.2s ease;
}

.collapsible-header:hover {
    background: #e9ecef;
}

.suggestion-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.expand-icon {
    font-size: 12px;
    transition: transform 0.2s ease;
    color: #667eea;
}

.suggestion-content {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
    opacity: 1;
    max-height: 1000px;
}

.suggestion-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
}

.collapsible .suggestion-text {
    padding: 0 10px 10px 10px;
    margin-top: 0;
}

.connection-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e53e3e;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    z-index: 1000;
}

.notification.error {
    background: #e53e3e;
}

.notification.success {
    background: #48bb78;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .control-panel {
        order: -1;
    }
}

.icon {
    font-size: 1.1em;
}

.live-words-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    color: #495057;
}

.live-words-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    min-height: 20px;
}

.live-word {
    display: inline;
    animation: fadeIn 0.2s ease-in;
    margin-right: 4px;
}

.live-word.recent {
    background-color: #fff3cd;
    padding: 1px 3px;
    border-radius: 2px;
    animation: highlightFade 2s ease-out;
}


/* Context input styling */
.input-hint {
    font-size: 12px;
    color: #718096;
    margin-top: 5px;
    font-style: italic;
}

.context-status {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    display: none;
}

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

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

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

@keyframes highlightFade {
    0% {
        background-color: #fff3cd;
    }
    100% {
        background-color: transparent;
    }
}

/* Authentication required message */
.auth-required-message {
    margin: 0 auto 40px;
    max-width: 800px;
}

.auth-prompt-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
    border: 2px solid #667eea;
}

.auth-prompt-card h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.auth-prompt-card p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.auth-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.auth-buttons .btn {
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    min-width: 140px;
}

.features-preview {
    background: #f7fafc;
    padding: 25px;
    border-radius: 10px;
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

.features-preview h3 {
    color: #4a5568;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.1rem;
}

.features-preview ul {
    list-style: none;
    padding: 0;
}

.features-preview li {
    padding: 8px 0;
    color: #2d3748;
    font-size: 0.95rem;
}

.main-content.disabled {
    opacity: 0.3;
    pointer-events: none;
    filter: blur(2px);
}

.auth-overlay {
    position: relative;
}

.auth-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .auth-prompt-card {
        padding: 30px 20px;
        margin: 0 20px;
    }
    
    .auth-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .auth-buttons .btn {
        width: 100%;
        max-width: 250px;
    }
}