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

:root {
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
    --red-50: #fef2f2;
    --red-200: #fecaca;
    --red-700: #b91c1c;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.header-title {
    font-size: 1.875rem;
    font-weight: bold;
    color: var(--gray-900);
}

.header-subtitle {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

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

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

.btn-secondary {
    background-color: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background-color: var(--gray-50);
}

.btn-reset {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--primary-600);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-link {
    color: var(--primary-600);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    background: none;
    border: none;
    cursor: pointer;
    margin-bottom: 1rem;
}

.btn-add {
    padding: 0.5rem;
    background-color: var(--gray-200);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
}

.btn-add:hover {
    background-color: var(--gray-300);
}

/* Icons */
.icon {
    width: 20px;
    height: 20px;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

/* Search */
.search-section {
    margin: 1.5rem 0;
}

.search-bar {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--gray-600);
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-600);
    box-shadow: 0 0 0 3px var(--primary-50);
}

/* Layout */
.main-container {
    padding: 2rem 1rem;
}

.content-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 1.5rem;
}

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

/* Sidebar */
.sidebar {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 1.5rem;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filter-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-title h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.filter-section {
    margin-bottom: 1.5rem;
}

.filter-subtitle {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.filter-options input[type="radio"] {
    cursor: pointer;
}

/* Main Content */
.main-content {
    min-height: 400px;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-600);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-message {
    background-color: var(--red-50);
    border: 1px solid var(--red-200);
    color: var(--red-700);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.project-count {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
}

.empty-state {
    background: white;
    border-radius: 0.5rem;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.empty-state p {
    color: var(--gray-600);
    margin-bottom: 1rem;
}

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

.project-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    transition: box-shadow 0.3s;
}

.project-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-language {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-sample {
    background-color: var(--primary-100);
    color: var(--primary-700);
}

.project-description {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tech-tag {
    padding: 0.25rem 0.5rem;
    background-color: var(--gray-100);
    color: var(--gray-700);
    font-size: 0.75rem;
    border-radius: 0.25rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-tag {
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-100);
    color: var(--primary-700);
    font-size: 0.75rem;
    border-radius: 9999px;
}

.project-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-size: 0.75rem;
    margin-bottom: 1rem;
}

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

.project-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 0.875rem;
    padding: 0.5rem;
}

.btn-icon {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: var(--gray-50);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 1rem;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 0.5rem;
    max-width: 42rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: bold;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-600);
    padding: 0.5rem;
}

.modal-close:hover {
    color: var(--gray-900);
}

.modal-close svg {
    width: 24px;
    height: 24px;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
}

.modal-footer .btn {
    flex: 1;
    justify-content: center;
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-600);
    box-shadow: 0 0 0 3px var(--primary-50);
}

textarea.form-input {
    resize: vertical;
}

.input-with-button {
    display: flex;
    gap: 0.5rem;
}

.input-with-button .form-input {
    flex: 1;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background-color: var(--gray-100);
    color: var(--gray-700);
    border-radius: 9999px;
    font-size: 0.875rem;
}

.tag-item.primary {
    background-color: var(--primary-100);
    color: var(--primary-700);
}

.tag-remove {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.tag-remove:hover {
    color: var(--gray-900);
}

.tag-remove svg {
    width: 14px;
    height: 14px;
}

/* File Upload */
.file-upload {
    border: 2px dashed var(--gray-300);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--gray-600);
    margin: 0 auto 0.5rem;
}

.file-input {
    display: none;
}

.file-label {
    color: var(--primary-600);
    font-weight: 500;
    cursor: pointer;
}

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

.file-name {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Alert */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: var(--red-50);
    border: 1px solid var(--red-200);
    color: var(--red-700);
}

/* Project Detail */
.detail-header {
    margin-bottom: 1.5rem;
}

.detail-title {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.detail-title h1 {
    font-size: 2rem;
    font-weight: bold;
}

.detail-meta {
    display: flex;
    gap: 1rem;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.detail-section p {
    color: var(--gray-700);
    line-height: 1.6;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.btn-danger {
    background-color: #dc2626;
    color: white;
    margin-left: auto;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-success {
    background-color: #16a34a;
    color: white;
}

.btn-success:hover {
    background-color: #15803d;
}

.btn-dark {
    background-color: var(--gray-900);
    color: white;
}

.btn-dark:hover {
    background-color: var(--gray-700);
}
