@import url('https://fonts.googleapis.com/css2?family=Play:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Play', sans-serif;
    color: #000000;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Контейнер для форм */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(10px);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    color: #333;
}

.input-group {
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'Play', sans-serif;
    font-size: 16px;
    transition: all 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #f7ee00;
    box-shadow: 0 0 0 3px rgba(247, 238, 0, 0.2);
}

.btn {
    width: 100%;
    padding: 12px;
    background-color: #f7ee00;
    color: #000000;
    border: none;
    border-radius: 10px;
    font-family: 'Play', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(247, 238, 0, 0.3);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid #f7ee00;
    color: #000000;
}

.link {
    text-align: center;
    margin-top: 20px;
}

.link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 700;
}

.link a:hover {
    text-decoration: underline;
}

/* Дашборд */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: white;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.sidebar h3 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f7ee00;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    padding: 10px;
    margin: 5px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    word-break: break-word;
}

.sidebar li:hover {
    background: #f7ee00;
    color: #000;
}

.sidebar li.active {
    background: #f7ee00;
    font-weight: bold;
}

.main-content {
    flex: 1;
    padding: 30px;
    background: #f5f5f5;
    overflow-y: auto;
}

.report-header {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.report-header input {
    width: 100%;
    padding: 10px;
    font-size: 24px;
    font-weight: bold;
    border: 2px solid transparent;
    border-radius: 5px;
    font-family: 'Play', sans-serif;
}

.report-header input:focus {
    outline: none;
    border-color: #f7ee00;
}

.sections-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    animation: fadeIn 0.3s ease;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    border: none;
    padding: 5px;
    width: 70%;
    font-family: 'Play', sans-serif;
    border-bottom: 2px solid transparent;
}

.section-title:focus {
    outline: none;
    border-bottom-color: #f7ee00;
}

.section-controls {
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s;
}

.icon-btn:hover {
    background: #f0f0f0;
    transform: scale(1.1);
}

.section-content {
    width: 100%;
    min-height: 150px;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-family: 'Play', sans-serif;
    resize: vertical;
    margin-bottom: 15px;
}

.section-content:focus {
    outline: none;
    border-color: #f7ee00;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.image-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    aspect-ratio: 1;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-controls {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 5px;
    background: rgba(255,255,255,0.9);
    padding: 5px;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.3s;
}

.image-item:hover .image-controls {
    opacity: 1;
}

.image-controls button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 5px;
}

.generate-btn {
    background: #f7ee00;
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-family: 'Play', sans-serif;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    transition: all 0.3s;
}

.generate-btn:hover {
    background: #e6d800;
    transform: translateY(-2px);
}

.keywords-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-family: 'Play', sans-serif;
    margin-bottom: 10px;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    animation: slideUp 0.3s ease;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

/* Админ панель */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 280px;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    padding: 30px 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-logo {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f7ee00;
}

.admin-nav {
    list-style: none;
}

.admin-nav li {
    margin-bottom: 10px;
}

.admin-nav a {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 500;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: #f7ee00;
    color: #000;
}

.admin-nav a i {
    margin-right: 10px;
    width: 20px;
    display: inline-block;
}

.admin-content {
    flex: 1;
    padding: 30px;
    background: #f5f5f5;
    margin-left: 280px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-title {
    font-size: 24px;
    font-weight: bold;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f7ee00;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 40px;
    margin-bottom: 15px;
    color: #f7ee00;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

/* Таблицы */
.admin-table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-table table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: #f8f8f8;
    padding: 15px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid #f7ee00;
}

.admin-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.admin-table tr:hover {
    background: #f9f9f9;
}

.admin-table .actions {
    display: flex;
    gap: 10px;
}

.admin-table .action-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.action-btn.view {
    background: #4CAF50;
    color: white;
}

.action-btn.download {
    background: #2196F3;
    color: white;
}

.action-btn.delete {
    background: #f44336;
    color: white;
}

.action-btn:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

/* Модальное окно просмотра отчета */
.report-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.preview-content {
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 10px;
    padding: 30px;
    animation: slideUp 0.3s ease;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f7ee00;
}

.preview-body {
    line-height: 1.6;
}

.preview-section {
    margin-bottom: 25px;
}

.preview-section h3 {
    color: #333;
    margin-bottom: 10px;
    padding-left: 10px;
    border-left: 4px solid #f7ee00;
}

.preview-section .content {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
}

.preview-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.preview-images img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.close-btn:hover {
    color: #000;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Загрузчик */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #f7ee00;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Адаптивность */
@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
    }
    
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: static;
    }
    
    .admin-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-table {
        overflow-x: auto;
    }
    
    .section-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .section-title {
        width: 100%;
    }
}