@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

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

body {
    font-family: 'Inter', sans-serif;
    background-color: #e8e8e8;
    color: #222;
    min-height: 100vh;
}

.layout {
    display: flex;
    min-height: 100vh;
    padding: 48px 56px;
    gap: 40px;
    box-sizing: border-box;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
}

.svg-logo {
    width: 100px;
    height: auto;
}

.header-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-btn {
    padding: 10px 24px;
    border: 1.5px solid #1a1a1a;
    border-radius: 30px;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s;
}

.header-btn:hover {
    background: #1a1a1a;
    color: #fff;
}

.header-username-btn {
    background: #00A6FF;
    color: #fff;
    border-color: #00A6FF;
}

.header-username-btn:hover {
    background: #0090e0;
    border-color: #0090e0;
}

/* ===== SIDEBAR ===== */
.carts-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 20px;
    padding: 40px 24px 24px;
    display: flex;
    flex-direction: column;
    height: fit-content;
    align-self: flex-start;
    position: sticky;
    top: 48px;
}

.carts-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.carts-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    text-decoration: none;
    color: #111;
    font-size: 16px;
    font-weight: 400;
    border-radius: 10px;
    transition: background 0.12s;
}

.carts-nav-item:hover { background: #f3f4f6; }
.carts-nav-item.active { font-weight: 600; }

.carts-nav-item svg {
    width: 20px; height: 20px;
    stroke: #111; flex-shrink: 0;
    stroke-width: 1.7; fill: none;
}

.carts-nav-item.no-icon svg { display: none; }

.carts-logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    margin-top: auto;
    cursor: pointer;
    color: #111;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: none; border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    transition: opacity 0.15s;
}

.carts-logout-btn:hover { opacity: 0.6; }
.carts-logout-btn svg { width: 20px; height: 20px; stroke: #111; stroke-width: 1.7; fill: none; }

/* ===== MAIN CONTENT ===== */
.main {
    flex: 1;
    min-width: 0;
}

/* Search bar */
.carts-search {
    max-width: 540px;
    margin-bottom: 12px;
}

.carts-search-input {
    width: 100%;
    border: none;
    outline: none;
    padding: 16px 22px 16px 54px;
    font-size: 16px;
    font-family: inherit;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239aa0a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") 18px center no-repeat;
    border-radius: 999px;
    color: #111;
}

.carts-search-input::placeholder { color: #ccc; }

/* Heading */
.page-title {
    font-size: 38px;
    font-weight: 800;
    color: #111;
    margin: 0 0 12px 0;
    line-height: 1;
    letter-spacing: -0.02em;
}

/* Link input */
.link-input {
    background: #fff;
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 24px;
}

.link-input input {
    border: none;
    outline: none;
    font-size: 15px;
    width: 100%;
    background: transparent;
    color: #333;
}

.link-input input::placeholder {
    color: #aaa;
}

/* Content card */
.content-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
}

/* Photo placeholders */
.photos-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.photo-placeholder {
    background: #d4d4d4;
    border-radius: 12px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 16px;
}

/* Info boxes */
.info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.info-box {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 20px 24px;
}

.info-box h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1a1a1a;
}

.info-box .details {
    font-size: 14px;
    line-height: 1.7;
    color: #444;
}

.info-box .details .label {
    color: #666;
}

.info-box .description-text {
    font-size: 14px;
    line-height: 1.7;
    color: #444;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Presentation text */
.presentation-section h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.slide-block {
    margin-bottom: 20px;
}

.slide-block h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.slide-block p {
    font-size: 14px;
    line-height: 1.65;
    color: #444;
}

/* Bottom buttons */
.actions-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
    justify-content: center;
}

.btn {
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: #1a9fff;
    color: #fff;
}

.btn-primary:hover {
    background: #0d8aee;
}

.btn-outline {
    background: #fff;
    color: #1a9fff;
    border: 1.5px solid #1a9fff;
}

.btn-outline:hover {
    background: #f0f8ff;
}

.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1.5px solid #1a9fff;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.btn-icon:hover {
    background: #f0f8ff;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
    color: #1a9fff;
}

/* Спиннер загрузки */
.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

/* ===== SCENARIO LOADING SPINNER ===== */
.scenario-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px 20px;
    color: #888;
    font-size: 15px;
}

.scenario-loading .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #1a9fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Улучшаем отображение текста сценария */
.info-box .description-text {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ===== SCENARIO TEXTAREA ===== */
.scenario-textarea {
    width: 100%;
    padding: 16px 20px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.7;
    font-family: inherit;
    color: #333;
    resize: vertical;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}

.scenario-textarea:focus {
    border-color: #1a9fff;
    box-shadow: 0 0 0 3px rgba(26, 159, 255, 0.1);
}

/* ===== LOADING SPINNER ===== */
.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

.scenario-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px 20px;
    color: #888;
    font-size: 15px;
}

.scenario-loading .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #1a9fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== SETTINGS FIELDS ===== */
.setting-field select,
.setting-field input {
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.setting-field select:focus,
.setting-field input:focus {
    border-color: #1a9fff;
    box-shadow: 0 0 0 3px rgba(26, 159, 255, 0.1);
}

/* Улучшаем отображение текста сценария */
.info-box .description-text {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: #f9fafb;
    padding: 16px 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* Кнопка генерации презентации */
#generatePresentationBtn {
    padding: 12px 28px;
    font-size: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 900px) {
    .layout {
        flex-direction: column;
        padding: 16px;
    }

    .sidebar {
       width: 100%;
       position: static;
       flex-direction: row;
       flex-wrap: wrap;
       gap: 8px;
     }
     
     .sidebar-nav {
       flex-direction: row;
       flex-wrap: wrap;
     }
     
     .sidebar-bottom {
       margin-top: 0;
       padding-top: 0;
     }
     
     .photos-row {
       grid-template-columns: 1fr;
     }
     
     .info-row {
       grid-template-columns: 1fr;
     }
}
