/* Подключаем современный шрифт */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Цветовая палитра и переменные */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f9fafb;
    --surface: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --danger: #ef4444;
    --success: #10b981;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Базовые настройки */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Шапка и Подвал */
.header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header a {
    color: var(--text-main) !important;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.header a:hover {
    color: var(--primary) !important;
}

.logo a {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary) !important;
    letter-spacing: -0.5px;
}

.footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

/* Формы (Авторизация, Регистрация) */
.center-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.form-container {
    background-color: var(--surface);
    padding: 40px;
    border-radius: var(--radius);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.form-container h1 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 700;
}

label {
    font-weight: 500;
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-main);
}

input[type="text"], 
input[type="password"], 
input[type="email"], 
input[type="tel"], 
input[type="number"], 
select, 
textarea {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 15px;
    transition: all 0.2s ease;
    background-color: #fcfcfc;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    background-color: var(--surface);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Кнопки */
input[type="submit"], .dashboard-btn {
    width: 100%;
    background-color: var(--primary);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    display: block;
    text-decoration: none;
    box-sizing: border-box;
    transition: background-color 0.2s, transform 0.1s;
}

input[type="submit"]:hover, .dashboard-btn:hover {
    background-color: var(--primary-hover);
}

input[type="submit"]:active, .dashboard-btn:active {
    transform: scale(0.98);
}

.register-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.register-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.register-link a:hover {
    text-decoration: underline;
}

/* Доска объявлений (Главная страница) */
.page-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
}

.board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.card {
    background-color: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card h2 {
    margin-top: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
}

.description {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.5;
    flex-grow: 1;
}

.meta {
    margin-top: 15px;
    font-size: 14px;
    color: var(--text-muted);
    background: var(--bg-color);
    padding: 10px;
    border-radius: 6px;
}

.price {
    font-weight: 700;
    font-size: 22px;
    margin: 20px 0 10px 0;
    color: var(--primary);
}

.contact {
    font-size: 14px;
    border-top: 1px solid var(--border);
    padding-top: 15px;
    color: var(--text-main);
}

/* Таблица модерации */
.table-wrapper {
    overflow-x: auto;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.moderation-table {
    width: 100%;
    border-collapse: collapse;
}

.moderation-table th, .moderation-table td {
    border-bottom: 1px solid var(--border);
    padding: 16px;
    text-align: left;
    font-size: 14px;
}

.moderation-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.moderation-table tr:last-child td {
    border-bottom: none;
}

.inline-form {
    display: inline-block;
    margin: 0 4px;
}

.approve-btn, .delete-btn {
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    font-size: 13px;
    transition: opacity 0.2s;
}

.approve-btn {
    background-color: var(--success);
    color: white;
}

.delete-btn {
    background-color: var(--danger);
    color: white;
}

.approve-btn:hover, .delete-btn:hover {
    opacity: 0.9;
}