/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --text-color: #1e293b;
    --text-light: #64748b;
    --bg-color: #f8fafc;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Навигация */
.navbar {
    background: var(--white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

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

/* Кнопки */
.btn, .btn-primary, .btn-secondary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

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

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

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

.btn-secondary:hover {
    background: #475569;
}

/* Сообщения */
.messages-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1001;
    max-width: 400px;
}

.alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    background: var(--white);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success {
    border-left: 4px solid var(--success);
}

.alert-error {
    border-left: 4px solid var(--danger);
}

.alert-warning {
    border-left: 4px solid var(--warning);
}

/* Главная страница */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Карточки новостей */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 3rem 0;
}

.news-card {
    background: var(--white);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.news-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-card-content {
    padding: 1.5rem;
}

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

.news-card p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.news-card .date {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Формы */
.form-container {
    max-width: 500px;
    margin: 3rem auto;
    background: var(--white);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* Список тикетов */
.ticket-list {
    padding: 3rem 0;
}

.ticket-item {
    background: var(--white);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.ticket-item:hover {
    transform: translateX(5px);
}

.ticket-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.ticket-status.open {
    background: #dbeafe;
    color: #1e40af;
}

.ticket-status.in_progress {
    background: #fef3c7;
    color: #92400e;
}

.ticket-status.closed {
    background: #f3f4f6;
    color: #374151;
}

/* Чат тикетов */
.chat-container {
    max-width: 800px;
    margin: 2rem auto;
    background: var(--white);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 1.5rem;
}

.chat-messages {
    padding: 2rem;
    max-height: 500px;
    overflow-y: auto;
}

.message {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    max-width: 70%;
}

.message.user {
    background: #eff6ff;
    margin-left: auto;
}

.message.admin {
    background: #f9fafb;
}

.message-author {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.message-text {
    color: var(--text-color);
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Футер */
.footer {
    background: var(--text-color);
    color: var(--white);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

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

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

/* Адаптивность */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .message {
        max-width: 85%;
    }
}
