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

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f9fafb;
    --card-bg: #ffffff;
    --text: #111827;
    --text-light: #6b7280;
    --border: #e5e7eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
}

/* Header/Nav */
nav {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.nav-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.nav-user {
    font-size: 14px;
    color: var(--text-light);
}

.nav-links {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding: 0 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-link {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s;
}

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

.btn-block {
    display: block;
    width: 100%;
}

.btn-secondary {
    background: var(--text-light);
}

.btn-danger {
    background: var(--danger);
}

.btn-small {
    padding: 8px 12px;
    font-size: 14px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

input[type="text"],
input[type="url"],
input[type="password"],
input[type="color"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background: var(--card-bg);
}

input[type="file"] {
    padding: 8px;
    font-size: 14px;
}

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

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.card-meta {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.card-screenshot {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 12px;
    max-height: 400px;
    object-fit: cover;
}

.card-link {
    display: block;
    color: var(--primary);
    text-decoration: none;
    word-break: break-all;
    margin-bottom: 8px;
    font-size: 14px;
}

.card-comment {
    color: var(--text);
    margin-bottom: 12px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* Tags */
.tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 8px;
}

.tag-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* Flash messages */
.flash-messages {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 1000;
    max-width: 500px;
    margin: 0 auto;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.alert-success {
    background: var(--success);
    color: white;
}

.alert-error {
    background: var(--danger);
    color: white;
}

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 640px) {
    .card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .btn-small {
        width: 100%;
    }
}

/* Utility classes */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-small { font-size: 14px; }
