/**
 * SAP Expert AI - Public Interface Styles
 * Professional Deloitte-style design
 */

/* ============================================
   Deloitte Theme - Professional Corporate Design
   ============================================ */

.sap-expert-portal {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1400px;
    margin: 40px auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* Header */
.portal-header {
    background: linear-gradient(135deg, #0076A8 0%, #005A87 100%); /* Deloitte blue */
    color: #ffffff;
    padding: 30px 40px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.portal-logo {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-icon {
    font-size: 48px;
    background: rgba(255,255,255,0.2);
    padding: 15px 20px;
    border-radius: 10px;
}

.logo-text h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.tagline {
    margin: 5px 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.portal-user {
    text-align: right;
}

.user-greeting {
    display: block;
    font-size: 16px;
    margin-bottom: 5px;
}

.user-role {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Navigation Tabs */
.portal-nav {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    padding: 0 20px;
}

.nav-tab {
    background: none;
    border: none;
    padding: 20px 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.nav-tab:hover {
    background: rgba(0,118,168,0.05);
    color: #0076A8;
}

.nav-tab.active {
    color: #0076A8;
    background: #ffffff;
    border-bottom-color: #0076A8;
}

.tab-icon {
    font-size: 20px;
}

/* Content Area */
.portal-content {
    min-height: 600px;
}

.tab-panel {
    display: none;
    padding: 40px;
    animation: fadeIn 0.4s;
}

.tab-panel.active {
    display: block;
}

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

.panel-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.panel-header h2 {
    margin: 0 0 10px;
    font-size: 26px;
    color: #212529;
    font-weight: 700;
}

.panel-header p {
    margin: 0;
    color: #6c757d;
    font-size: 15px;
}

/* Tool Container */
.tool-container {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    background: #ffffff;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #0076A8;
    box-shadow: 0 0 0 3px rgba(0,118,168,0.1);
}

textarea.form-control {
    resize: vertical;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
}

/* Buttons */
.form-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #0076A8 0%, #005A87 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,118,168,0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,118,168,0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

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

.btn-secondary {
    background: #6c757d;
    color: #ffffff;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-icon {
    font-size: 18px;
}

/* Output Area */
.output-area {
    min-height: 100px;
}

.loading-state,
.success-state,
.error-state {
    text-align: center;
    padding: 40px;
    border-radius: 8px;
}

.loading-state {
    background: #e3f2fd;
    border: 2px solid #90caf9;
}

.success-state {
    background: #e8f5e9;
    border: 2px solid #81c784;
}

.error-state {
    background: #ffebee;
    border: 2px solid #e57373;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e3f2fd;
    border-top-color: #0076A8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.success-icon,
.error-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

/* Code Result */
.code-result {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

.code-result pre {
    background: #282c34;
    color: #abb2bf;
    padding: 20px;
    margin: 0;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
}

.code-result code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.code-result button {
    margin: 15px;
}

/* Chat Container */
.chat-container {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

.chat-history {
    height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.chat-message {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    animation: slideIn 0.3s;
}

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

.message-avatar {
    width: 40px;
    height: 40px;
    background: #0076A8;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: #6c757d;
}

.message-content {
    flex: 1;
    background: #ffffff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.message-author {
    font-weight: 700;
    color: #0076A8;
    margin-bottom: 5px;
    font-size: 13px;
}

.message-text {
    color: #495057;
    line-height: 1.6;
}

.typing-indicator {
    padding: 10px 20px;
    background: #e9ecef;
    border-radius: 20px;
    display: inline-block;
    margin-left: 55px;
    font-style: italic;
    color: #6c757d;
}

.chat-input-area {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.chat-input-area textarea {
    flex: 1;
}

.chat-input-area button {
    align-self: flex-end;
}

.quick-questions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
    padding: 15px 20px;
    background: #e3f2fd;
    border-radius: 8px;
}

.quick-label {
    font-weight: 600;
    color: #0076A8;
    margin-right: 10px;
}

.quick-btn {
    background: #ffffff;
    border: 2px solid #0076A8;
    color: #0076A8;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.quick-btn:hover {
    background: #0076A8;
    color: #ffffff;
}

/* Projects/History */
.projects-container {
    background: #f8f9fa;
    padding: 40px;
    border-radius: 8px;
    min-height: 400px;
}

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

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    color: #495057;
    margin-bottom: 10px;
}

.empty-state p {
    color: #6c757d;
}

/* Footer */
.portal-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 20px 40px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-info p {
    margin: 0;
    color: #6c757d;
    font-size: 13px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-link {
    color: #0076A8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.footer-link:hover {
    text-decoration: underline;
}

/* Access Messages */
.sap-public-message {
    max-width: 600px;
    margin: 60px auto;
    text-align: center;
    padding: 40px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.sap-message-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.sap-public-message h3 {
    color: #212529;
    margin-bottom: 15px;
}

.sap-public-message p {
    color: #6c757d;
    margin-bottom: 10px;
    line-height: 1.6;
}

.sap-public-message a {
    color: #0076A8;
    font-weight: 600;
    text-decoration: none;
}

.sap-public-message a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sap-expert-portal {
        margin: 0;
        border-radius: 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .portal-user {
        text-align: center;
    }
    
    .portal-nav {
        overflow-x: auto;
        padding: 0;
    }
    
    .nav-tab {
        padding: 15px 20px;
        font-size: 13px;
    }
    
    .tab-panel {
        padding: 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 15px;
    }
}
