/* Enhanced styles for Gateway-protected Damocles Task Management */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* Main container */
.container {
    background: white;
    margin: 2rem auto;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    width: 95%;
    max-width: 600px;
    overflow: hidden;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
}

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

.app-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.security-indicator {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.security-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* Authentication container */
.auth-container {
    padding: 2rem;
}

.auth-card {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.auth-card h2 {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.auth-card p {
    color: #6b7280;
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Google login button */
.google-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: white;
    border: 2px solid #e5e7eb;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-bottom: 1.5rem;
}

.google-login-btn:hover {
    border-color: #d1d5db;
    background: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.google-icon {
    width: 20px;
    height: 20px;
}

/* Auth info */
.auth-info {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    text-align: left;
}

.auth-info p {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.auth-info ul {
    list-style: none;
    padding-left: 0;
}

.auth-info li {
    padding: 0.25rem 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.auth-info li::before {
    content: "✓ ";
    color: #10b981;
    font-weight: bold;
}

/* User container */
.user-container {
    padding: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 10px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
}

.user-info {
    flex: 1;
    text-align: left;
}

.user-info h3 {
    color: #374151;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.user-info p {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.auth-status {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.status-indicator {
    color: #10b981;
    font-weight: 500;
}

.gateway-indicator {
    color: #6366f1;
    font-weight: 500;
}

.logout-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.logout-btn:hover {
    background: #dc2626;
}

/* Task form */
.task-form {
    padding: 2rem;
}

.task-form h2 {
    color: #374151;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    color: #6b7280;
    font-size: 0.8rem;
}

/* Submit button */
.submit-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-bottom: 1rem;
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

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

/* Form security info */
.form-security-info {
    background: #f0f9ff;
    border: 1px solid #e0f2fe;
    padding: 1rem;
    border-radius: 8px;
    text-align: left;
}

.form-security-info p {
    font-weight: 600;
    color: #0369a1;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-security-info ul {
    list-style: none;
    padding-left: 0;
}

.form-security-info li {
    padding: 0.25rem 0;
    color: #0369a1;
    font-size: 0.8rem;
}

.form-security-info li::before {
    content: "🔒 ";
}

/* Message area */
.message-area {
    margin: 1rem 2rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.success-message {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Connection status */
.connection-status {
    background: #f8fafc;
    padding: 1rem 2rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.status-item {
    display: flex;
    gap: 0.5rem;
}

.status-label {
    color: #6b7280;
    font-weight: 500;
}

.status-value {
    color: #374151;
    font-weight: 600;
}

/* Footer */
.app-footer {
    background: #1f2937;
    color: #d1d5db;
    padding: 2rem;
    text-align: center;
}

.footer-content {
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #6366f1;
}

.version-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6b7280;
    padding-top: 1rem;
    border-top: 1px solid #374151;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: #aaa;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover {
    color: #000;
}

.modal-content h3 {
    color: #374151;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.modal-content h4 {
    color: #4b5563;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
    font-size: 1.1rem;
}

.modal-content ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.modal-content li {
    margin-bottom: 0.3rem;
    color: #6b7280;
}

.modal-content code {
    background: #f3f4f6;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.modal-content pre {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0.5rem 0;
}

/* Loading state */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Responsive design */
@media (max-width: 640px) {
    .container {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .app-header {
        padding: 1.5rem;
    }
    
    .app-header h1 {
        font-size: 1.8rem;
    }
    
    .security-indicator {
        position: static;
        margin-top: 1rem;
    }
    
    .user-profile {
        flex-direction: column;
        text-align: center;
    }
    
    .user-info {
        text-align: center;
    }
    
    .connection-status {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .version-info {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 1.5rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* Focus styles for accessibility */
button:focus,
input:focus,
a:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .container {
        border: 2px solid #000;
    }
    
    .submit-btn,
    .google-login-btn {
        border: 2px solid #000;
    }
}

/* Task Breakdown Styles */
.task-breakdown-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.project-overview {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #4f46e5;
}

.project-overview h3 {
    color: #1e293b;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.project-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.project-meta span {
    background: #e0e7ff;
    color: #3730a3;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.project-overview .approach {
    color: #64748b;
    font-style: italic;
    line-height: 1.6;
}

.task-breakdown h4 {
    color: #1e293b;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.2s ease;
    position: relative;
}

.task-item:hover {
    border-color: #4f46e5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
    transform: translateY(-1px);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.task-header h5 {
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.priority-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.priority-badge.high {
    background: #fef2f2;
    color: #dc2626;
}

.priority-badge.medium {
    background: #fffbeb;
    color: #d97706;
}

.priority-badge.low {
    background: #f0fdf4;
    color: #16a34a;
}

.task-description {
    color: #64748b;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.task-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.task-meta span {
    background: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.task-skills {
    color: #64748b;
    font-size: 0.875rem;
}

.task-skills strong {
    color: #374151;
}

/* Processing Status Styles */
.processing-status {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: center;
}

.processing-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.processing-indicator p {
    color: #1e293b;
    font-weight: 500;
    margin: 0;
}

.processing-indicator small {
    color: #64748b;
    font-size: 0.875rem;
}

.error-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.error-icon {
    font-size: 2rem;
}

.error-indicator p {
    color: #dc2626;
    font-weight: 500;
    margin: 0;
}

/* Responsive Design for Task Breakdown */
@media (max-width: 768px) {
    .task-breakdown-container {
        padding: 1rem;
        margin: 0.5rem 0;
    }
    
    .project-overview {
        padding: 1rem;
    }
    
    .project-overview h3 {
        font-size: 1.2rem;
    }
    
    .project-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .task-item {
        padding: 1rem;
    }
    
    .task-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .task-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .processing-status {
        padding: 1rem;
    }
}