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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Header Styles */
header {
    background: #101010;
    color: white;
    padding: 1rem 2rem;
}

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

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

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

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem;
}

/* Landing Page Styles */
.hero-section {
    text-align: center;
    margin-bottom: 4rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 4rem 2rem;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(102,126,234,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(118,75,162,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.hero-content h2 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-weight: 700;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.3rem;
    color: #555;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.auth-section {
    margin: 2rem 0;
}

.auth-info {
    margin-top: 1.5rem;
    color: #7f8c8d;
    font-size: 0.95rem;
    font-style: italic;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h3 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 700;
}

.section-header p {
    font-size: 1.2rem;
    color: #7f8c8d;
    max-width: 500px;
    margin: 0 auto;
}

/* Features Section */
.features-section {
    margin: 6rem 0;
    padding: 4rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.feature-card {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
}

.feature-card h4 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-weight: 600;
}

.feature-card p {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 4rem 2rem;
    border-radius: 20px;
    margin: 4rem 0;
}

.cta-content h3 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Dashboard Styles */
.dashboard-main {
    max-width: 1000px;
    margin: 0 auto;
}

.loading-state, .error-state {
    text-align: center;
    padding: 3rem;
}

.loading-state p {
    font-size: 1.2rem;
    color: #7f8c8d;
}

.error-state {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    color: #c66;
}

/* Dashboard Welcome */
.dashboard-welcome {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
}

.welcome-content h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.welcome-content p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.dashboard-stats {
    display: flex;
    gap: 1rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 140px;
    backdrop-filter: blur(10px);
}

.stat-icon {
    font-size: 1.5rem;
}

.stat-info h4 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.stat-info p {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.dashboard-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    padding: 1.5rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.card-header h3 {
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 600;
}

.card-content {
    padding: 1.5rem;
}

.card-description {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Profile Card */
.profile-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.info-value {
    color: #2c3e50;
    font-weight: 500;
}

.role-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.user-id {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    background: #e9ecef;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* Enhanced Button Styles */
.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.btn-outline:hover {
    background: white;
    color: #667eea;
    transform: translateY(-2px);
}

.btn-icon {
    margin-right: 0.5rem;
    font-size: 1.1em;
}

/* Quick Actions */
.quick-actions {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.quick-actions h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.action-item {
    text-align: center;
    padding: 1.5rem;
    background: #f8f9ff;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.action-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

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

.action-item h4 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.action-item p {
    color: #666;
    font-size: 0.9rem;
}

/* Enhanced AI Loading */
.loading-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e1e8ff;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.response-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.response-header h4 {
    color: #2c3e50;
    font-weight: 600;
}

.user-info-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.user-info-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.user-details {
    display: grid;
    gap: 0.5rem;
}

.user-details p {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.user-details p:last-child {
    border-bottom: none;
}

/* AI Section */
.ai-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.ai-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.ai-section p {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
}

.ai-input-container {
    margin-bottom: 2rem;
}

.ai-textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
    margin-bottom: 1rem;
}

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

.ai-process-btn {
    width: 100%;
    margin-top: 0.5rem;
}

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

.ai-loading-state {
    background: #f8f9ff;
    border: 2px solid #e1e8ff;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    margin-top: 1rem;
}

.ai-loading-state::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e1e8ed;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

.ai-response-container {
    background: #f8f9ff;
    border: 2px solid #e1e8ff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.ai-response-container h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.ai-response-text {
    line-height: 1.6;
}

.ai-response-item {
    margin-bottom: 1.5rem;
}

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

.ai-response-item strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 0.5rem;
}

.user-input {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    margin: 0;
    font-style: italic;
    color: #555;
}

.ai-output {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #2c3e50;
}

.ai-response-meta {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e8ff;
    text-align: right;
}

.ai-response-meta small {
    color: #7f8c8d;
    font-style: italic;
}

.ai-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

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

/* AI Response */
.ai-response {
    background: #f8f9ff;
    border: 2px solid #e1e8ff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.ai-response h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.response-content {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    line-height: 1.5;
}

/* Error Messages */
.error-message {
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    color: #c66;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
}

footer p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Loading Animation */
.loading-state::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e1e8ed;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 0;
        box-shadow: none;
    }
    
    header {
        padding: 1rem;
    }
    
    nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .hero-content h2 {
        font-size: 2.5rem;
    }
    
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Dashboard Responsive */
    .dashboard-welcome {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .dashboard-stats {
        justify-content: center;
    }
    
    .stat-item {
        min-width: auto;
        flex: 1;
    }
}

@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 1.8rem;
    }
    
    .hero-badge {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .section-header h3 {
        font-size: 2rem;
    }
    
    .cta-content h3 {
        font-size: 1.8rem;
    }
    
    /* Dashboard Mobile */
    .dashboard-welcome {
        padding: 1.5rem;
    }
    
    .welcome-content h1 {
        font-size: 1.8rem;
    }
    
    .dashboard-stats {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .card-header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    
    .user-id {
        font-size: 0.7rem;
        word-break: break-all;
    }
}
