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

:root {
    --black: #000000;
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    --blue: #3b82f6;
    --red: #ef4444;
    --green: #22c55e;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--white);
    color: var(--black);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--black);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Page System */
.page {
    display: none;
    min-height: 100vh;
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Navbar */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

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

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-logo.clickable {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.nav-logo.clickable:hover {
    opacity: 0.7;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--gray-200);
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-google {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--white);
    color: var(--black);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-google {
    background: var(--white);
    color: var(--black);
    border: 1px solid var(--gray-300);
    width: 100%;
    justify-content: center;
}

.btn-google svg {
    width: 20px;
    height: 20px;
}

.btn-google:hover {
    background: var(--gray-100);
}

.back-button {
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--black);
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 8px;
}

.back-button svg {
    width: 20px;
    height: 20px;
}

.back-button:hover {
    background: var(--gray-100);
}

.btn-icon {
    padding: 0.5rem;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--black);
}

.btn-icon:hover:not(:disabled) {
    background: var(--gray-100);
}

.btn-icon:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-danger {
    background: var(--red);
    color: var(--white);
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Hero Section */
.hero {
    max-width: 1400px;
    margin: 0 auto;
    padding: 6rem 2rem;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 6rem;
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--gray-600);
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

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

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.feature-card {
    padding: 2rem;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    transition: all 0.4s ease;
    background: var(--white);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    border-color: var(--black);
}

.feature-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1.5rem;
    color: var(--black);
}

.feature-icon svg {
    width: 100%;
    height: 100%;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.feature-card p {
    color: var(--gray-600);
    line-height: 1.6;
}

/* Sign In */
.signin-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.signin-container .back-button {
    position: absolute;
    top: 2rem;
    left: 2rem;
}

.signin-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 3rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    animation: scaleIn 0.4s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.signin-card h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.signin-card p {
    color: var(--gray-600);
    margin-bottom: 2rem;
}

/* Dashboard */
.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
    min-height: calc(100vh - 200px);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

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

.forum-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.forum-card:hover {
    border-color: var(--black);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.forum-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.forum-card .forum-slug {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.forum-card .forum-stats {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
    font-size: 0.85rem;
    color: var(--gray-600);
}

.forum-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.forum-card-actions button {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Builder */
.builder-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: calc(100vh - 81px);
    background: var(--gray-50);
}

.builder-sidebar {
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-section {
    padding: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    font-size: 1rem;
    margin: 0;
}

.sidebar-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

.form-group small {
    display: block;
    margin-top: 0.375rem;
    color: var(--gray-500);
    font-size: 0.75rem;
}

.slug-input {
    position: relative;
    display: flex;
    align-items: center;
}

.slug-prefix {
    position: absolute;
    left: 0.625rem;
    color: var(--gray-500);
    font-weight: 500;
    font-size: 0.875rem;
}

.slug-input input {
    padding-left: 1.5rem;
}

.slug-status {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.slug-status.available {
    color: var(--green);
}

.slug-status.taken {
    color: var(--red);
}

.divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0;
}

.pages-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.page-item {
    padding: 0.625rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.page-item:hover {
    border-color: var(--gray-400);
}

.page-item.active {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

.page-item-actions button {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}

.add-elements-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.element-btn {
    padding: 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.element-btn svg {
    width: 20px;
    height: 20px;
}

.element-btn:hover {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

.element-btn:hover svg {
    stroke: var(--white);
}

/* Builder Preview */
.builder-preview {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 2rem;
    display: flex;
    justify-content: center;
}

.preview-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.preview-controls span {
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 100px;
    text-align: center;
}

.preview-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    justify-content: center;
}

.form-preview {
    max-width: 700px;
    width: 100%;
    background: var(--white);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-200);
    min-height: 400px;
}

.page-title-input {
    width: 100%;
    padding: 0.75rem 0;
    font-size: 2rem;
    font-weight: 700;
    border: none;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.page-title-input:focus {
    outline: none;
    border-bottom-color: var(--black);
}

.preview-elements {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.preview-element {
    padding: 1.25rem;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
    position: relative;
}

.preview-element:hover {
    border-color: var(--gray-400);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.preview-element.selected {
    border-color: var(--black);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.preview-element label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.625rem;
    font-size: 1rem;
}

.preview-element input,
.preview-element textarea,
.preview-element select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.9375rem;
    pointer-events: none;
    background: var(--gray-50);
}

.preview-element img {
    max-width: 100%;
    border-radius: 6px;
}

.preview-element .element-controls {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.preview-element:hover .element-controls {
    opacity: 1;
}

.element-controls button {
    padding: 0.25rem 0.5rem;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

.element-controls button:hover {
    background: var(--gray-100);
}

/* Builder Editor */
.builder-editor {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 1.5rem 2rem;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.builder-editor.active {
    display: block;
}

.editor-group {
    margin-bottom: 1.25rem;
}

.editor-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.editor-group input,
.editor-group textarea,
.editor-group select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
}

.editor-group input:focus,
.editor-group textarea:focus,
.editor-group select:focus {
    outline: none;
    border-color: var(--black);
}

.checkbox-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.checkbox-group label {
    margin: 0;
}

.poll-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.option-row {
    display: flex;
    gap: 0.5rem;
}

.option-row input {
    flex: 1;
}

.option-row button {
    padding: 0.625rem;
    background: var(--red);
    color: var(--white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Form View */
.form-container {
    min-height: calc(100vh - 200px);
    padding: 3rem 2rem;
}

.form-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.form-content {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 3rem;
    animation: fadeIn 0.6s ease;
}

.form-page {
    animation: fadeIn 0.4s ease;
}

.form-page h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.form-page p {
    color: var(--gray-600);
    margin-bottom: 2rem;
}

.form-response-element {
    margin-bottom: 2rem;
}

.form-response-element label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    font-size: 1.05rem;
}

.form-response-element input,
.form-response-element textarea,
.form-response-element select {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-response-element input:focus,
.form-response-element textarea:focus {
    outline: none;
    border-color: var(--black);
}

.form-navigation {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-200);
}

.form-navigation button {
    flex: 1;
}

.input-large {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 1rem;
    font-family: inherit;
}

.input-large:focus {
    outline: none;
    border-color: var(--black);
}

.error-message {
    color: var(--red);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.success-message {
    color: var(--green);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Requests */
.requests-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 200px);
}

.requests-list {
    display: grid;
    gap: 1rem;
}

.request-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    animation: slideIn 0.3s ease;
}

.request-card:hover {
    border-color: var(--black);
    transform: translateX(5px);
}

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.request-date {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.request-data {
    display: grid;
    gap: 0.75rem;
}

.request-field {
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: 8px;
}

.request-field strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: scaleIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

/* Footer */
.footer {
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--gray-200);
    margin-top: 4rem;
    color: var(--gray-600);
}

.creator-link {
    color: var(--blue);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-500);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.full-width {
    width: 100%;
}

/* Responsive */
@media (max-width: 1024px) {
    .builder-container {
        grid-template-columns: 250px 1fr;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .builder-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .builder-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
        max-height: 50vh;
    }

    .form-content {
        padding: 2rem 1.5rem;
    }

    .signin-card {
        padding: 2rem;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .user-info span {
        display: none;
    }

    .add-elements-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}
