/**
 * Taskip Form Generator Styles
 *
 * Extracted from JavaScript for better performance and configurability
 */

.taskip-form-generator {
    max-width: 1200px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.taskip-generator-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #6366f1;
    color: white;
    border-radius: 12px;
}

.taskip-generator-header h3 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}

.taskip-generator-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
}

.taskip-generator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    min-height: 600px;
}

@media (max-width: 768px) {
    .taskip-generator-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Left Side: Form */
.taskip-form-side {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.taskip-form-section h4 {
    color: #2c3e50;
    margin: 0 0 20px 0;
    font-size: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.taskip-form-group {
    margin-bottom: 20px;
}

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

.taskip-form-group input,
.taskip-form-group select,
.taskip-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.taskip-form-group input:focus,
.taskip-form-group select:focus,
.taskip-form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.taskip-form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.taskip-form-actions {
    display: block !important;
    margin-top: 30px;
    text-align: center;
}

.taskip-generate-btn {
    background: #6366f1;
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.taskip-generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.taskip-generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Right Side: AI Preview */
.taskip-ai-side {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: 100%;
    max-height: 80vh;
    overflow: hidden;
}

.taskip-ai-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e1e5e9;
    background: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.taskip-ai-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
}

.taskip-ai-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.taskip-status-text {
    font-size: 14px;
    color: #7f8c8d;
}

.taskip-typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #3498db;
    font-size: 14px;
}

.taskip-typing-dots {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.taskip-typing-dots span {
    width: 6px;
    height: 6px;
    background: #3498db;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.taskip-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.taskip-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.taskip-ai-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    min-height: 200px;
}

.taskip-ai-content::-webkit-scrollbar {
    width: 8px;
}

.taskip-ai-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.taskip-ai-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.taskip-ai-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.taskip-ai-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

.taskip-placeholder-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.taskip-ai-placeholder h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 24px;
}

.taskip-ai-placeholder p {
    margin: 0 0 30px 0;
    font-size: 16px;
    line-height: 1.6;
}

.taskip-ai-generator-features {
    display: grid;
    gap: 12px;
    max-width: 300px;
    margin: 0 auto;
    list-style: none;
    padding: 0;
}

.taskip-ai-generator-feature {
    text-align: left;
    font-size: 14px;
    margin: 0;
    color: #27ae60;
    font-weight: 500;
}

.taskip-document-content {
    padding: 30px;
    font-family: 'Times New Roman', serif;
    line-height: 1.8;
    color: #2c3e50;
    text-align: left;
    min-height: 400px;
}

.taskip-ai-actions {
    padding: 20px 30px;
    border-top: 1px solid #e1e5e9;
    background: white;
    border-radius: 0 0 12px 12px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.taskip-ai-actions button {
    background: white;
    border: 2px solid #3498db;
    color: #3498db;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.taskip-ai-actions button:hover {
    background: #3498db;
    color: white;
}

/* Writing effect for AI content */
.taskip-writing-effect {
    opacity: 0;
    animation: fadeInText 0.5s ease-in-out forwards;
}

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

.taskip-typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #3498db;
    animation: typewriter 2s steps(40, end), blink 1s infinite;
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* Enhanced Loading States */
@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.taskip-brain-pulse {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.taskip-pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    border: 3px solid #3498db;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 2s infinite ease-out;
    opacity: 0.6;
}

.taskip-pulse-ring-delayed {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    border: 2px solid #e74c3c;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 2s infinite ease-out 0.5s;
    opacity: 0.4;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.8;
    }
    50% {
        opacity: 0.4;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0;
    }
}

.taskip-progress-bar {
    width: 100%;
    height: 4px;
    background: #ecf0f1;
    border-radius: 2px;
    margin: 20px 0;
    overflow: hidden;
}

.taskip-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #e74c3c, #f39c12);
    background-size: 200% 100%;
    border-radius: 2px;
    width: 0%;
    animation: progressColorFlow 1s infinite linear;
}

@keyframes progressFill {
    from { width: 0%; }
    to { width: 100%; }
}

@keyframes progressColorFlow {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Typewriter Effects */
.taskip-typewriter-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #6366f1;
    color: white;
    border-radius: 8px;
    margin-bottom: 20px;
    transition: opacity 0.3s ease;
}

.taskip-ai-avatar {
    font-size: 24px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

.taskip-typing-status {
    font-weight: 500;
    font-size: 14px;
}

.taskip-document-preview {
    border-radius: 8px;
    min-height: 200px;
    line-height: 1.6;
}

.taskip-cursor {
    color: #3498db;
    animation: blink 1s infinite;
    font-weight: bold;
}

/* Document Formatting */
.taskip-document-preview h1,
.taskip-document-preview h2,
.taskip-document-preview h3 {
    color: #2c3e50;
    margin-top: 25px;
    margin-bottom: 15px;
}

.taskip-document-preview h1 {
    font-size: 24px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.taskip-document-preview h2 {
    font-size: 20px;
    color: #e74c3c;
}

.taskip-document-preview h3 {
    font-size: 18px;
    color: #f39c12;
}

.taskip-document-preview p {
    margin-bottom: 15px;
    color: #34495e;
}

.taskip-document-preview strong {
    color: #2c3e50;
    font-weight: 600;
}

.taskip-document-preview table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.taskip-document-preview td {
    padding: 8px 12px;
    border: 1px solid #ddd;
}

/* Enhanced Document Formatting */
.taskip-h1, .taskip-h2, .taskip-h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.taskip-header-icon {
    flex-shrink: 0;
}

.taskip-separator {
    margin: 30px 0;
    text-align: center;
}

.taskip-separator-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, #3498db, transparent);
    border-radius: 1px;
}

.taskip-placeholder {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 4px;
    color: #6c757d;
    font-style: italic;
    font-size: 0.9em;
    border: 1px dashed #dee2e6;
}

.taskip-bold {
    color: #2c3e50;
    font-weight: 600;
}

.taskip-paragraph {
    margin-bottom: 15px;
    line-height: 1.7;
    color: #34495e;
}

.taskip-paragraph-break {
    height: 10px;
}

.taskip-document-list {
    margin: 15px 0;
    padding-left: 0;
    list-style: none;
}

.taskip-list-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    padding: 5px 0;
}

.taskip-list-icon {
    color: #3498db;
    margin-top: 4px;
    flex-shrink: 0;
}

.taskip-document-numbered-list {
    margin: 15px 0;
    padding-left: 0;
    list-style: none;
    counter-reset: taskip-counter;
}

.taskip-numbered-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
    padding: 8px 0;
    counter-increment: taskip-counter;
}

.taskip-number {
    background: #3498db;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.taskip-money {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.taskip-duration {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.taskip-document-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.taskip-table-row:nth-child(even) {
    background: #f8f9fa;
}

.taskip-table-row:nth-child(odd) {
    background: white;
}

.taskip-table-row:first-child {
    background: #3498db !important;
    color: white;
    font-weight: 600;
}

.taskip-table-cell {
    padding: 12px 16px;
    border: 1px solid #dee2e6;
    text-align: left;
    transition: background 0.2s ease;
}

.taskip-table-row:first-child .taskip-table-cell {
    border-color: rgba(255,255,255,0.2);
}

.taskip-table-cell:hover {
    background: #e3f2fd;
}

/* AI Avatar Animation Enhancement */
.taskip-ai-avatar svg {
    color: white;
    animation: bounce 2s infinite;
}

/* Quota Display Styles */
.taskip-quota-display {
    margin: 20px 0;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.taskip-quota-display.quota-exceeded {
    background: linear-gradient(135deg, #fee, #fdd);
    border-color: #dc3545;
    color: #721c24;
}

.taskip-quota-display.quota-warning {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border-color: #ffc107;
    color: #856404;
}

.taskip-quota-display .quota-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.taskip-quota-display .quota-content {
    flex: 1;
}

.taskip-quota-display .quota-status {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.taskip-quota-display .quota-description {
    font-size: 14px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.taskip-quota-display .quota-progress {
    margin-bottom: 6px;
}

.taskip-quota-display .quota-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.taskip-quota-display .quota-fill {
    height: 100%;
    background: currentColor;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.taskip-quota-display .quota-text {
    font-size: 12px;
    font-weight: 500;
}

.taskip-quota-display .quota-reset {
    font-size: 12px;
    opacity: 0.8;
}