/* ========================================
   ГЛОБАЛЬНЫЕ СТИЛИ
   ======================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #f5f7fa;
}

code {
    font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
        monospace;
}

/* ========================================
   ЛЕНДИНГ СТРАНИЦА
   ======================================== */

.landing-page {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    color: #333;
}

/* Шапка */
.landing-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

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

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Герой секция */
.hero-section {
    padding: 4rem 0;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-title .highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.hero-stats {
    display: flex;
    gap: 2rem;
}

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

.stat-number {
    font-size: 1.5rem;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

/* Мокап */
.hero-image {
    text-align: center;
}

.mockup {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 2rem;
    display: inline-block;
}

.mockup-screen {
    background: #2c3e50;
    border-radius: 15px;
    padding: 1.5rem;
    min-width: 400px;
}

.mockup-content {
    background: white;
    border-radius: 10px;
    min-height: 500px;
    overflow: hidden;
}

.mockup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 60px;
}

.mockup-canvas {
    padding: 2rem;
}

.mockup-component {
    height: 80px;
    margin-bottom: 1rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    border: 2px solid #667eea;
}

.mockup-component.header {
    height: 100px;
}

.mockup-component.hero {
    height: 150px;
}

.mockup-component.footer {
    height: 60px;
}

/* Преимущества */
.features-section {
    padding: 5rem 0;
    background: white;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

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

.feature-card {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #667eea;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #333;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

/* CTA секция */
.cta-section {
    padding: 5rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: 1rem;
}

.cta-form input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
}

.cta-form button {
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    background: white;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.cta-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

/* Футер */
.landing-footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.landing-footer p {
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

/* ========================================
   КОНСТРУКТОР
   ======================================== */

.builder {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #f5f7fa;
}

/* Тулбар */
.toolbar {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toolbar-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}

.toolbar-btn {
    padding: 0.6rem 1.2rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toolbar-btn:hover {
    background: #f5f7fa;
    border-color: #667eea;
    color: #667eea;
}

.toolbar-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.export-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Рабочая область */
.workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Палитра компонентов */
.component-palette {
    width: 280px;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.palette-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.palette-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.palette-search input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #f8f9fa;
}

.palette-categories {
    padding: 1rem;
}

.palette-category {
    margin-bottom: 1.5rem;
}

.category-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.palette-item {
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: grab;
    transition: all 0.2s;
}

.palette-item:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: scale(1.02);
}

.palette-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.palette-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
}

/* Холст */
.canvas {
    flex: 1;
    background: #e9ecef;
    overflow: auto;
    position: relative;
}

.canvas-content {
    min-height: 100%;
    background: white;
    margin: 40px auto;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    min-height: 800px;
}

/* Панель свойств */
.properties-panel {
    width: 320px;
    background: white;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.component-type {
    font-size: 0.8rem;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
}

.panel-content {
    padding: 1.5rem;
}

.properties-group {
    margin-bottom: 2rem;
}

.properties-group h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.property-item {
    margin-bottom: 1.2rem;
}

.property-item label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.property-item input[type="text"],
.property-item input[type="number"],
.property-item select,
.property-item textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.property-item input[type="text"]:focus,
.property-item input[type="number"]:focus,
.property-item select:focus,
.property-item textarea:focus {
    outline: none;
    border-color: #667eea;
}

.property-item textarea {
    min-height: 80px;
    resize: vertical;
}

.property-item input[type="color"] {
    width: 60px;
    height: 40px;
    border: none;
    cursor: pointer;
    padding: 0;
}

.properties-actions {
    padding-top: 1.5rem;
    border-top: 1px solid #f0f0f0;
}

.delete-btn {
    width: 100%;
    padding: 1rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.delete-btn:hover {
    background: #c0392b;
}

/* Пустое состояние */
.properties-panel.empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state {
    text-align: center;
    color: #999;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #666;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ========================================
   КНОПКИ
   ======================================== */

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* ========================================
   АДАПТИВНОСТЬ
   ======================================== */

@media (max-width: 1024px) {
    .workspace {
        flex-direction: column;
    }

    .component-palette {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        max-height: 300px;
    }

    .palette-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .properties-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid #e0e0e0;
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .mockup-screen {
        min-width: 300px;
    }

    .cta-form {
        flex-direction: column;
    }
}