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

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #8b5cf6;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --success: #22c55e;
    --error: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styles */
.header {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, var(--surface) 0%, var(--background) 100%);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo-img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
}

/* Section Styles */
.section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Quick Generate Section */
.quick-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.quick-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.quick-btn .icon {
    font-size: 1.5rem;
}

.quick-result {
    position: relative;
}

/* Output Box */
.output-box {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    min-height: 80px;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.output-box.large {
    min-height: 150px;
    max-height: 400px;
}

.output-box .placeholder {
    color: var(--text-secondary);
    font-style: italic;
    font-family: inherit;
}

/* Copy Button */
.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Bulk Generation Section */
.bulk-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: flex-end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.control-group input[type="number"] {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    width: 120px;
}

.control-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Primary Button */
.primary-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.5rem;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

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

/* Bulk Result */
.bulk-result {
    position: relative;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.result-header h3 {
    font-size: 1rem;
    color: var(--text-secondary);
}

.export-buttons {
    display: flex;
    gap: 0.5rem;
}

.export-btn {
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.export-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Custom Template Section */
.template-info {
    background: var(--background);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
}

.template-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.placeholder-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.placeholder-list code {
    background: var(--surface-hover);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.template-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.template-controls .control-group {
    width: 100%;
}

.template-controls textarea {
    width: 100%;
    min-height: 100px;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    resize: vertical;
}

.template-controls textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.template-result {
    position: relative;
}

/* Footer */
.footer {
    text-align: center;
    padding: 1.5rem;
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--success);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Scrollbar Styling */
.output-box::-webkit-scrollbar {
    width: 8px;
}

.output-box::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: 4px;
}

.output-box::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.output-box::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .logo-img {
        width: 40px;
        height: 40px;
    }

    .tagline {
        font-size: 0.9rem;
    }

    .section {
        padding: 1rem;
    }

    .quick-buttons {
        grid-template-columns: repeat(3, 1fr);
    }

    .quick-btn {
        padding: 0.75rem 0.5rem;
    }

    .quick-btn .icon {
        font-size: 1.25rem;
    }

    .quick-btn span:last-child {
        font-size: 0.8rem;
    }

    .bulk-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group input[type="number"] {
        width: 100%;
    }

    .primary-btn {
        width: 100%;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .export-buttons {
        width: 100%;
    }

    .export-btn {
        flex: 1;
        text-align: center;
    }

    .placeholder-list code {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1.5rem 1rem;
    }

    .main-content {
        padding: 1rem 0.5rem;
    }

    .quick-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .checkbox-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .output-box {
        font-size: 0.8rem;
    }
}

/* Animation for data generation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.output-box:not(:has(.placeholder)) {
    animation: fadeIn 0.3s ease;
}
