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

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1f2937;
    --light: #f9fafb;
    --border: #e5e7eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border);
}

h1 {
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    color: #6b7280;
    font-size: 1.1rem;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

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

/* Secciones */
.create-section,
.projects-section {
    background: var(--light);
    padding: 30px;
    border-radius: 15px;
}

.create-section h2,
.projects-section h2 {
    margin-bottom: 20px;
    color: var(--dark);
}

/* Formularios */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

input,
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
    resize: vertical;
    min-height: 150px;
}

/* Botones */
.btn-primary,
.btn-secondary {
    padding: 14px 32px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    width: auto;
    padding: 10px 20px;
}

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

/* Loading */
.loading {
    text-align: center;
    padding: 30px;
    margin-top: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-detail {
    font-size: 14px;
    color: #6b7280;
    margin-top: 10px;
}

/* Proyectos */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.projects-grid {
    display: grid;
    gap: 20px;
}

.project-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid var(--primary);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.project-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.project-card h3 {
    color: var(--dark);
    margin-bottom: 10px;
}

.project-card p {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 15px;
}

.project-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 14px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-concept { background: #fef3c7; color: #d97706; }
.badge-gdd { background: #dbeafe; color: #2563eb; }
.badge-architecture { background: #e9d5ff; color: #9333ea; }
.badge-mechanics { background: #fce7f3; color: #db2777; }
.badge-development { background: #fed7aa; color: #ea580c; }
.badge-completed { background: #d1fae5; color: #059669; }
.badge-error { background: #fee2e2; color: #dc2626; }

/* Estados vacíos */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.empty-state p:first-child {
    font-size: 48px;
    margin-bottom: 10px;
}

/* Detalle de Proyecto */
.back-btn {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.back-btn:hover {
    text-decoration: underline;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
}

.tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.3s;
    white-space: nowrap;
}

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

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

.tab-content {
    min-height: 400px;
}

/* Cards de información */
.info-card {
    background: var(--light);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.info-card h3 {
    margin-bottom: 15px;
    color: var(--dark);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary);
}

.stat-label {
    color: #6b7280;
    font-size: 14px;
    margin-top: 5px;
}

/* Progress bar */
.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s;
}

/* Documentos */
.document-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.document-meta {
    display: flex;
    gap: 15px;
    margin: 15px 0;
    font-size: 14px;
    color: #6b7280;
}

.document-content {
    margin-top: 20px;
    line-height: 1.8;
    color: #374151;
}

/* Mecánicas */
.mechanics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.mechanic-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mechanic-card.priority-high {
    border-left-color: var(--danger);
}

.mechanic-card.priority-medium {
    border-left-color: var(--warning);
}

.mechanic-card.priority-low {
    border-left-color: var(--success);
}

details {
    margin-top: 15px;
}

summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary);
}

/* Código */
.code-card {
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.code-header {
    background: var(--dark);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.code-header h3 {
    flex: 1;
    font-size: 16px;
}

.btn-copy {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

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

.code-desc {
    padding: 15px 20px;
    background: var(--light);
    border-bottom: 1px solid var(--border);
}

pre {
    margin: 0;
    padding: 20px;
    background: #1e1e1e;
    color: #d4d4d4;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
}

code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* Logs */
.log-entry {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    border-left: 5px solid var(--success);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.log-entry.status-error {
    border-left-color: var(--danger);
}

.log-header {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 10px;
}

.log-time {
    font-size: 14px;
    color: #6b7280;
}

.log-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
}

.log-details {
    padding: 15px;
    background: var(--light);
    border-radius: 6px;
    margin-top: 10px;
}