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

:root {
    --primary-blue: #4F46E5;
    --primary-blue-hover: #4338CA;
    --text-dark: #1F2937;
    --text-gray: #6B7280;
    --bg-white: #FFFFFF;
    --bg-light: #F9FAFB;
    --border-gray: #E5E7EB;
    --error-red: #EF4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #F9FAFB 0%, #E0E7FF 50%, #FCE7F3 100%);
    min-height: 100vh;
    color: var(--text-dark);
}

/* Header Styles */
.header {
    background: var(--bg-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
}

.logo-text-reslide {
    color: var(--text-dark);
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#auth-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-signin {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    transition: color 0.2s;
}

.btn-signin:hover {
    color: var(--primary-blue);
}

.btn-signup {
    background: var(--primary-blue);
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

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

.btn-logout {
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-gray);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-logout:hover {
    background: var(--bg-light);
    border-color: var(--text-dark);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-blue);
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 80px);
}

/* Welcome Page */
.welcome-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 2rem;
}

.welcome-container {
    max-width: 900px;
    width: 100%;
    text-align: center;
}

.welcome-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.welcome-subtitle {
    font-size: 1.5rem;
    color: var(--text-gray);
    margin-bottom: 1rem;
}

.welcome-description {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.welcome-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 4rem;
}

.btn-welcome-primary {
    background: var(--primary-blue);
    color: white;
    text-decoration: none;
    padding: 1rem 2.5rem;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

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

.btn-welcome-secondary {
    background: var(--bg-white);
    color: var(--primary-blue);
    text-decoration: none;
    padding: 1rem 2.5rem;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid var(--primary-blue);
    transition: all 0.2s;
}

.btn-welcome-secondary:hover {
    background: var(--primary-blue);
    color: white;
}

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

.feature-item {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: var(--text-gray);
    font-size: 0.95rem;
}

/* Carousel Page */
.carousel-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 2rem;
}

.carousel-container {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

.carousel-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 2.5rem;
}

.input-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.tab-btn {
    background: var(--bg-white);
    border: 1px solid var(--border-gray);
    color: var(--text-gray);
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--text-dark);
    border-color: var(--text-dark);
    font-weight: 600;
}

.tab-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.input-section {
    margin-bottom: 2rem;
}

.text-input {
    width: 100%;
    padding: 1.5rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    background: var(--bg-white);
    color: var(--text-dark);
}

.text-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn-create-carousel {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-create-carousel:hover {
    background: var(--primary-blue-hover);
}

.carousel-result {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-white);
    border-radius: 0.75rem;
    border: 1px solid var(--border-gray);
}

/* Auth Pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 2rem;
}

.auth-container {
    background: var(--bg-white);
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 450px;
    width: 100%;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-gray);
    text-align: center;
    margin-bottom: 2rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-input {
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-dark);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-error {
    background: #FEE2E2;
    color: var(--error-red);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.btn-auth-submit {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 0.5rem;
}

.btn-auth-submit:hover {
    background: var(--primary-blue-hover);
}

.auth-footer {
    text-align: center;
    color: var(--text-gray);
    font-size: 0.95rem;
    margin-top: 1rem;
}

.auth-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

.auth-link:hover {
    text-decoration: underline;
}

/* Review Page */
.review-page {
    min-height: calc(100vh - 80px);
    background: #F3F4F6;
    padding: 2rem;
}

.review-container {
    max-width: 1400px;
    margin: 0 auto;
}

.review-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.review-nav-right {
    display: flex;
    gap: 1rem;
}

.btn-back {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.btn-edit-toggle {
    background: #E5E7EB;
    color: var(--text-dark);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-edit-toggle:hover {
    background: #D1D5DB;
}

.btn-next {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.review-main {
    display: flex;
    gap: 2rem;
    position: relative;
}

.review-content {
    flex: 1;
    background: white;
    border-radius: 1rem;
    padding: 2rem;
}

.review-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.review-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.review-subtitle {
    font-size: 1rem;
    color: var(--text-gray);
}

.btn-add-slide {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-add-slide:hover {
    background: var(--primary-blue-hover);
}

.slides-preview-container {
    margin-top: 2rem;
}

.slides-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.slide-card {
    background: white;
    border: 1px solid var(--border-gray);
    border-radius: 0.75rem;
    padding: 1.5rem;
    position: relative;
    transition: box-shadow 0.2s;
    cursor: pointer;
}

.slide-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.slide-delete {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: #EC4899;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.slide-delete:hover {
    opacity: 0.7;
}

.slide-content {
    margin-top: 0.5rem;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.slide-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-blue);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.slide-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-height: 3em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.5em;
}

.slide-subtitle {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-height: 4.5em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.5em;
}

/* Edit Sidebar */
.edit-sidebar {
    position: fixed;
    right: -400px;
    top: 80px;
    bottom: 0;
    width: 400px;
    background: white;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.edit-sidebar.active {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-gray);
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.sidebar-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-gray);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.sidebar-close:hover {
    color: var(--text-dark);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.slide-edit-form {
    margin-bottom: 2rem;
}

.slide-edit-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.slide-edit-title {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.slide-edit-title:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.slide-edit-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    color: var(--text-dark);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-gray);
}

.btn-update {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
}

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

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        padding: 1rem;
    }
    
    .welcome-title {
        font-size: 2.5rem;
    }
    
    .welcome-subtitle {
        font-size: 1.25rem;
    }
    
    .welcome-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-welcome-primary,
    .btn-welcome-secondary {
        width: 100%;
    }
    
    .welcome-features {
        grid-template-columns: 1fr;
    }
    
    .carousel-title {
        font-size: 2rem;
    }
    
    .auth-container {
        padding: 2rem 1.5rem;
    }

    .review-page {
        padding: 1rem;
    }

    .review-content {
        padding: 1.5rem;
    }

    .slides-preview {
        grid-template-columns: 1fr;
    }

    .edit-sidebar {
        width: 100%;
        right: -100%;
    }

    .modal-content {
        width: 90%;
        max-width: 500px;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    margin: 1rem;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-gray);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-gray);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.modal-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.modal-input {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.modal-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.modal-textarea {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    color: var(--text-dark);
    min-height: 200px;
    line-height: 1.5;
}

.modal-textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-gray);
}

.btn-modal-cancel {
    background: transparent;
    color: var(--text-gray);
    border: 1px solid var(--border-gray);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modal-cancel:hover {
    background: var(--bg-light);
    border-color: var(--text-gray);
    color: var(--text-dark);
}

.btn-modal-save {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-modal-save:hover {
    background: var(--primary-blue-hover);
}

/* Styles Page */
.styles-page {
    min-height: calc(100vh - 80px);
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.styles-container {
    width: 100%;
}

.styles-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.styles-main {
    width: 100%;
}

.styles-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 2rem;
}

.styles-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 3rem;
    background: var(--bg-white);
    padding: 0.25rem;
    border-radius: 0.75rem;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab-button {
    padding: 0.75rem 2rem;
    border: none;
    background: transparent;
    color: var(--text-gray);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.tab-button.active {
    background: var(--bg-light);
    color: var(--text-dark);
}

.tab-button:hover:not(.active) {
    color: var(--text-dark);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.template-category {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    text-align: left;
}

.styles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.style-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.style-card.selected {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
}

.style-preview {
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 0.75rem 0.75rem 0 0;
    position: relative;
    overflow: hidden;
}

.reslide-preview {
    background: rgb(3, 72, 169);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 1.5rem;
    color: white;
}

.reslide-preview .preview-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: white;
    text-align: left;
    font-family: Arial, Helvetica, sans-serif;
}

.reslide-preview .preview-body {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.5;
    font-family: Arial, Helvetica, sans-serif;
}

.template-preview {
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}

.template-1 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 300"><rect fill="%2310b981" width="200" height="300"/><path d="M0 200 Q50 150 100 200 T200 200 L200 300 L0 300 Z" fill="%23059669" opacity="0.5"/></svg>');
}

.template-2 {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 300"><rect fill="%231f2937" width="200" height="300"/><rect x="20" y="20" width="160" height="200" fill="%23111827" opacity="0.3"/></svg>');
}

.template-3 {
    background: repeating-conic-gradient(#f3f4f6 0% 25%, #e5e7eb 0% 50%) 50% / 20px 20px;
    background-color: #ffffff;
}

.template-overlay {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 0.5rem;
}

.template-name {
    font-size: 0.875rem;
    font-weight: 600;
    display: block;
}

.style-label {
    padding: 1rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    background: var(--bg-white);
}

/* Responsive styles for styles page */
@media (max-width: 768px) {
    .styles-page {
        padding: 1rem;
    }

    .styles-title {
        font-size: 2rem;
    }

    .styles-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .tab-button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Edit Style Page */
.edit-style-page {
    min-height: calc(100vh - 80px);
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.edit-style-container {
    width: 100%;
}

.edit-style-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.edit-style-nav-right {
    display: flex;
    gap: 1rem;
}

.btn-save-template {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-gray);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save-template:hover {
    background: var(--border-gray);
}

.btn-export {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.edit-style-main {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    align-items: start;
    position: relative;
}

.edit-style-content {
    overflow: hidden;
}

.edit-style-content {
    background: var(--bg-white);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

.edit-style-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Slides Carousel */
.slides-carousel-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.slides-carousel {
    position: relative;
    width: 100%;
    max-width: 700px;
    height: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: pan-y;
    margin: 0 auto;
}

.slides-carousel-track {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.slide-carousel-item {
    position: absolute;
    width: 100%;
    max-width: 280px;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.6s ease,
                z-index 0.6s ease;
    transform-origin: center center;
    cursor: pointer;
    will-change: transform, opacity;
    pointer-events: auto;
}

.slide-preview-card {
    background: var(--bg-white);
    border: 1px solid var(--border-gray);
    border-radius: 0.75rem;
    overflow: hidden;
    aspect-ratio: 9 / 16;
    width: 100%;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease;
}

.slide-carousel-item:hover .slide-preview-card {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.carousel-nav {
    background: var(--bg-white);
    border: 2px solid var(--border-gray);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-dark);
    z-index: 20;
    flex-shrink: 0;
}

.carousel-nav:hover {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
    transform: scale(1.1);
}

.carousel-nav:active {
    transform: scale(0.95);
}

.carousel-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.carousel-indicator {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: var(--border-gray);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.carousel-dot:hover {
    background: var(--text-gray);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: var(--primary-blue);
    width: 12px;
    height: 12px;
}

.slide-preview-content {
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgb(3, 72, 169);
    color: white;
}

.slide-preview-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
    line-height: 1.2;
}

.slide-preview-body {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.5;
    flex: 1;
    overflow-y: auto;
}

.edit-style-panel {
    background: var(--bg-white);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 100px;
    z-index: 100;
}

.panel-header {
    margin-bottom: 1.5rem;
}

.panel-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.panel-content {
    margin-bottom: 2rem;
    max-height: 500px;
    overflow-y: auto;
}

.slide-edit-block {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-gray);
}

.slide-edit-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.slide-block-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

.slide-block-title {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.slide-block-title:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.slide-block-body {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-dark);
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.slide-block-body:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.panel-footer {
    border-top: 1px solid var(--border-gray);
    padding-top: 1.5rem;
}

.font-selector {
    margin-bottom: 1.5rem;
}

.panel-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.font-dropdown {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-gray);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-dark);
    background: var(--bg-white);
    cursor: pointer;
}

.font-dropdown:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.colors-selector {
    margin-bottom: 0;
}

.colors-hint {
    font-size: 0.75rem;
    color: var(--text-gray);
    margin-bottom: 0.75rem;
}

.colors-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.color-add {
    width: 40px;
    height: 40px;
    border: 2px dashed var(--border-gray);
    border-radius: 0.5rem;
    background: var(--bg-light);
    color: var(--text-gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.color-add:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background: var(--bg-white);
}

.color-swatch {
    width: 40px;
    height: 40px;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-swatch.selected {
    border-color: var(--text-dark);
    border-width: 3px;
    box-shadow: 0 0 0 2px var(--bg-white);
}

/* Responsive styles for edit-style page */
@media (max-width: 1024px) {
    .edit-style-main {
        grid-template-columns: 1fr;
    }

    .edit-style-panel {
        position: static;
    }

    .slides-result {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .edit-style-page {
        padding: 1rem;
    }

    .edit-style-title {
        font-size: 1.5rem;
    }

    .edit-style-nav {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .edit-style-nav-right {
        flex-direction: column;
    }
}

/* Export Modal Styles */
.export-modal-content {
    max-width: 900px;
}

.export-modal-body {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.export-preview-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-height: 450px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 0.5rem;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

.export-preview-slide {
    background: white;
    border-radius: 0.5rem;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    aspect-ratio: 9 / 16;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    max-height: 220px;
    overflow: hidden;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.export-preview-slide .slide-preview-card {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: rgb(3, 72, 169);
}

.export-preview-slide .slide-preview-content {
    width: 100%;
    height: 100%;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgb(3, 72, 169);
    color: white;
    box-sizing: border-box;
}

.export-preview-slide .slide-preview-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.export-preview-slide .slide-preview-body {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    flex: 1;
    word-break: break-word;
}

.export-more-text {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1rem;
    color: var(--text-gray);
    font-size: 1rem;
    font-weight: 600;
}

.export-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-export-png,
.btn-export-pdf {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 180px;
    justify-content: center;
}

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

.btn-export-png:hover:not(:disabled) {
    background: var(--primary-blue-hover);
}

.btn-export-pdf {
    background: var(--error-red);
    color: white;
}

.btn-export-pdf:hover:not(:disabled) {
    background: #DC2626;
}

.btn-export-png:disabled,
.btn-export-pdf:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.export-slide-full {
    font-family: inherit;
}

@media (max-width: 768px) {
    .export-preview-container {
        grid-template-columns: 1fr;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    .btn-export-png,
    .btn-export-pdf {
        width: 100%;
    }
    
    .export-preview-slide {
        max-height: 200px;
    }
}

