/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #e5e7eb;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #5a67d8, #6b46c1);
    transform: scale(1.1);
}

/* Dark theme support */
[data-theme="dark"] {
    background: #1a202c;
    color: #e2e8f0;
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-textarea,
[data-theme="dark"] .form-select {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

[data-theme="dark"] .form-section {
    background: #2d3748;
    border-color: #4a5568;
}

[data-theme="dark"] .form-section-header {
    background: #1a202c;
    border-color: #4a5568;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

.animate-pulse-slow {
    animation: pulse 2s infinite;
}

.gradient-bg {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

pre, code, textarea.font-code {
    font-family: 'Fira Code', monospace;
}

/* Form elements */
.form-input, .form-textarea, .form-select {
    width: 100%;
    background: white;
    border: 1px solid #e5e7eb;
    color: #111827;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.form-input::placeholder, .form-textarea::placeholder {
    color: #9ca3af;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.form-section {
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

/* Accordion Header */
.form-section-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.form-section-header:hover {
    background: #f1f5f9;
}

.form-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f2937;
}

.form-section-content {
    padding: 1rem;
    transition: max-height 0.3s ease-out;
    max-height: 2000px;
}

.form-section-content.hidden {
    display: none;
}

.chevron-icon {
    width: 1rem;
    height: 1rem;
    color: #6b7280;
    transition: transform 0.3s ease;
}

.form-section-header.closed .chevron-icon {
    transform: rotate(-90deg);
}

/* Buttons */
.btn {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

/* Gemini Button Style */
.btn-gemini {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
    font-weight: 600;
    position: relative;
}

.btn-gemini:hover {
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* Output Tabs */
.tab-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 0.25rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.tab-btn-active {
    background: #3b82f6;
    color: white;
}

.tab-btn-inactive {
    color: #6b7280;
    background: #f3f4f6;
}

.tab-btn-inactive:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Tech Stack Builder */
.tech-tab {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 0.25rem;
    cursor: pointer;
    border: 1px solid #d1d5db;
    background: white;
    transition: all 0.2s ease;
}

.tech-tab.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
}

@media (min-width: 640px) {
    .tech-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .tech-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.tech-checkbox {
    display: flex;
    align-items: center;
    padding: 0.375rem;
    background: #f8fafc;
    border-radius: 0.25rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.tech-checkbox:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.tech-checkbox input {
    height: 0.875rem;
    width: 0.875rem;
    color: #3b82f6;
    border-color: #d1d5db;
    border-radius: 0.125rem;
}

.tech-checkbox input:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.tech-checkbox label {
    margin-left: 0.375rem;
    display: block;
    font-size: 0.8rem;
    color: #374151;
    cursor: pointer;
}

/* Preview Pane */
.preview-pane {
    padding: 1rem;
    overflow-y: auto;
    width: 100%;
    height: 100%;
    font-size: 0.9rem;
    line-height: 1.6;
}

.preview-pane h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.preview-pane h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
    margin-top: 1.5rem;
}

.preview-pane h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    margin-top: 1rem;
}

.preview-pane p {
    margin-bottom: 1rem;
}

.preview-pane a {
    color: #2563eb;
}

.preview-pane a:hover {
    text-decoration: underline;
}

.preview-pane pre {
    background: #1f2937;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-size: 0.875rem;
    font-family: 'Fira Code', monospace;
    margin-bottom: 1rem;
}

.preview-pane code {
    background: #e5e7eb;
    color: #dc2626;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-family: 'Fira Code', monospace;
}

.preview-pane pre code {
    background: transparent;
    color: white;
    padding: 0;
}

.preview-pane ul, .preview-pane ol {
    list-style: disc;
    list-style-position: inside;
    margin-bottom: 1rem;
    margin-left: 1rem;
}

.preview-pane table {
    border-collapse: collapse;
    border: 1px solid #d1d5db;
    width: 100%;
    margin-bottom: 1rem;
}

.preview-pane th, .preview-pane td {
    border: 1px solid #d1d5db;
    padding: 0.5rem;
    text-align: left;
}

.preview-pane th {
    background: #f3f4f6;
}

.preview-pane img {
    max-width: 100%;
    height: auto;
}

/* Project Card */
.project-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: #f8fafc;
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.project-card-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1f2937;
}

.project-remove-btn {
    color: #dc2626;
    cursor: pointer;
    font-size: 0.75rem;
    background: none;
    border: none;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.project-remove-btn:hover {
    background: #fee2e2;
    color: #b91c1c;
}

/* Advanced animations and effects */
.form-section {
    transition: all 0.3s ease;
}

.form-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(0, 0, 0, 0.1);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Loading animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    animation: spin 1s linear infinite;
}

/* Success animation */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

.animate-bounce {
    animation: bounce 1s ease;
}

/* Glow effect */
.glow {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
}

/* Floating animation */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* Typewriter effect */
@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid #667eea;
    white-space: nowrap;
    animation: typewriter 2s steps(40, end);
}

/* Neon glow effect */
.neon {
    text-shadow: 
        0 0 5px #667eea,
        0 0 10px #667eea,
        0 0 15px #667eea,
        0 0 20px #667eea;
}

/* Matrix rain effect */
@keyframes matrix {
    0% { transform: translateY(-100vh); }
    100% { transform: translateY(100vh); }
}

.matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.matrix-rain::before {
    content: '01010101010101010101010101010101';
    position: absolute;
    color: #00ff41;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    animation: matrix 10s linear infinite;
    opacity: 0.1;
}

/* Particle background */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* New animations for auto-fill functionality */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes fieldHighlight {
    0% {
        background-color: #f0f9ff;
        transform: scale(1);
    }
    50% {
        background-color: #e0f2fe;
        transform: scale(1.02);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

.field-updated {
    animation: fieldHighlight 0.8s ease;
}

/* Loading states */
.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Success states */
.success-border {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3) !important;
}

.success-glow {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

/* Enhanced form animations */
.form-input.auto-filled {
    background: linear-gradient(45deg, #f0f9ff, #e0f2fe);
    border-color: #0ea5e9;
    animation: fieldHighlight 1s ease;
}

.tech-checkbox.auto-selected {
    background: linear-gradient(45deg, #ecfdf5, #d1fae5);
    border-color: #10b981;
    animation: fieldHighlight 0.8s ease;
}

/* Project card animations */
.project-card.auto-added {
    animation: slideInUp 0.6s ease;
}

@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* GitHub username input enhancements */
.github-input-container {
    position: relative;
}

.github-input-loading {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.github-input-success {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.github-input-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    z-index: 1000;
    animation: slideInRight 0.5s ease;
}

.notification.success {
    background: linear-gradient(45deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.notification.error {
    background: linear-gradient(45deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.notification.info {
    background: linear-gradient(45deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Responsive improvements */
@media (max-width: 768px) {
    .form-section {
        margin-bottom: 0.5rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        font-size: 0.875rem;
    }
}
