/* AdminSistem Universal v2.0 - Stylesheet */

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #10b981;
    --danger: #ef4444;
    --background: #f9fafb;
    --surface: #ffffff;
    --border: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.hidden {
    display: none !important;
}

/* Auth Container */
#auth-container:not(.hidden) {
    display: flex !important;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

.auth-box {
    background: var(--surface);
    border-radius: 0.75rem;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.auth-box h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-box p {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
}

/* Header */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.5rem;
}

.user-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Navigation */
.nav-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    overflow-x: auto;
}

.nav-tab {
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 200ms;
    white-space: nowrap;
}

.nav-tab:hover {
    color: var(--primary);
}

.nav-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Tab Content */
#main-container:not(.hidden) {
    display: flex !important;
    flex-direction: column;
    min-height: 100vh;
}

.nav-tabs {
    margin-top: 0;
}

.tab-content {
    display: none;
    padding: 2rem 1rem;
    flex: 1;
}

.tab-content.active {
    display: block;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 200ms;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--background);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-large {
    width: 100%;
    padding: 1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    box-shadow: var(--shadow);
}

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

.stat-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

/* Generator Layout */
.generator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

@media (max-width: 1024px) {
    .generator-grid {
        grid-template-columns: 1fr;
    }
}

.generator-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.generator-result {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.generator-result h3 {
    margin-bottom: 1rem;
}

.content-box {
    flex: 1;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 1rem;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.95rem;
    line-height: 1.6;
}

.content-box.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.result-actions {
    display: flex;
    gap: 1rem;
}

/* Projects List */
.projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 200ms;
}

.project-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.project-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.project-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.project-card .meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Create Form */
.create-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.create-form .form-actions {
    margin-top: 1rem;
}

/* Messages */
.message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 0.375rem;
    display: none;
}

.message.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.message.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.history-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
}

.history-item h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.history-item .meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.history-item .content {
    background: var(--background);
    padding: 0.75rem;
    border-radius: 0.375rem;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.radio-label input[type="radio"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: var(--primary);
}

.radio-label span {
    user-select: none;
}

.radio-label:hover {
    color: var(--primary);
}

/* Recent Section */
.recent-section {
    margin-top: 2rem;
}

.recent-section h3 {
    margin-bottom: 1rem;
}

/* Batch Processing */
.batch-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1.5rem;
}

.batch-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.batch-section h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

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

.batch-job-card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.batch-job-info {
    flex: 1;
}

.batch-job-info h4 {
    margin-bottom: 0.25rem;
}

.batch-job-status {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.batch-job-actions {
    display: flex;
    gap: 0.5rem;
}

.batch-job-actions button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Prompts */
.prompts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

@media (max-width: 1024px) {
    .prompts-container {
        grid-template-columns: 1fr;
    }
}

.prompts-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.prompts-section h3 {
    margin-bottom: 1.5rem;
}

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

.prompt-card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 1rem;
}

.prompt-card h4 {
    margin-bottom: 0.25rem;
}

.prompt-card .meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.prompt-card .template {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    padding: 0.75rem;
    font-size: 0.875rem;
    max-height: 150px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 0.75rem;
}

.prompt-card .actions {
    display: flex;
    gap: 0.5rem;
}

.prompt-card .actions button {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Websites */
.websites-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

@media (max-width: 1024px) {
    .websites-container {
        grid-template-columns: 1fr;
    }
}

.websites-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.websites-section h3 {
    margin-bottom: 1.5rem;
}

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

.website-card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 1rem;
}

.website-card h4 {
    margin-bottom: 0.25rem;
}

.website-card .meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.website-card .actions {
    display: flex;
    gap: 0.5rem;
}

.website-card .actions button {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 640px) {
    .auth-box {
        padding: 1.5rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-tab {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .projects-list {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .result-actions {
        flex-direction: column;
    }

    .result-actions .btn {
        width: 100%;
    }
}
