:root {
    --primary-color: #ea580c;
    --primary-dark: #c2410c;
    --secondary-color: #f97316;
    --bg-light: #fff7ed;
    --bg-dark: #1f2937;
    --text-dark: #111827;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    background-attachment: fixed;
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar {
    background: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-brand i {
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-vip-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.nav-vip-badge i {
    font-size: 1rem;
}

.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-light);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.user-btn:hover {
    background: #fed7aa;
}

.user-btn i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    display: none;
    overflow: hidden;
}

.dropdown.show {
    display: block;
}

.dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: background 0.3s;
}

.dropdown a:hover {
    background: var(--bg-light);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--text-light);
    color: white;
}

.btn-secondary:hover {
    background: var(--text-dark);
}

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

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

.btn-block {
    width: 100%;
}

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

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

.editor-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.sidebar {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    height: fit-content;
    min-width: 300px;
    align-self: start;
}

.sidebar-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 2rem;
}

.sidebar-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-light);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #fed7aa;
}

.upload-area i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: var(--text-light);
    font-weight: 500;
}

.color-picker-section {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-picker-section label {
    font-weight: 500;
}

.color-picker-section input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
}

.emoji-categories {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
    width: 100%;
    flex-wrap: nowrap;
}

.emoji-cat-btn {
    flex: 1;
    min-width: 0;
    padding: 0.4rem 0;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 0.5rem;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.emoji-cat-btn:hover {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.emoji-cat-btn.active {
    border-color: var(--primary-color);
    background: var(--bg-light);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
}

.emoji-item {
    padding: 0.4rem;
    font-size: 1.6rem;
    border: none;
    background: var(--bg-light);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    width: 100%;
}

.emoji-item:hover {
    background: var(--primary-color);
    transform: scale(1.2);
}

.text-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.text-controls {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.text-controls label {
    font-weight: 500;
}

.text-controls input[type="color"] {
    width: 60px;
    height: 40px;
    min-width: 60px;
    max-width: 60px;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
}

.text-controls input[type="number"] {
    width: 80px;
    max-width: 100px;
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
}

.sidebar-section .btn {
    width: 100%;
    margin-bottom: 0.5rem;
}

.sidebar-section .btn:last-child {
    margin-bottom: 0;
}

.canvas-area {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

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

.canvas-header h2 {
    color: var(--primary-color);
}

.credits-display {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-light);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
}

.credits-display i {
    color: var(--warning-color);
    font-size: 1.2rem;
}

.canvas-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

#mainCanvas {
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    cursor: crosshair;
    max-width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    pointer-events: auto;
}

.canvas-footer {
    display: flex;
    justify-content: center;
}

.toast {
    position: fixed;
    top: 100px;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-xl);
    display: none;
    z-index: 2000;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

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

.toast.show {
    display: block;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 3000;
    overflow-y: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: modalFadeIn 0.3s ease-out;
}

.modal-large {
    max-width: 800px;
}

@keyframes modalFadeIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s;
}

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

.auth-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-light);
}

.auth-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.auth-form h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

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

.auth-form input {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.terms-checkbox input[type="checkbox"] {
    margin-top: 0.25rem;
    width: auto;
}

.terms-checkbox label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.terms-checkbox a {
    color: var(--primary-color);
    text-decoration: none;
}

.terms-checkbox a:hover {
    text-decoration: underline;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
}

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

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

.terms-company {
    color: var(--text-dark);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 0.5rem;
    line-height: 1.6;
}

.terms-content {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 1rem;
}

.terms-content h3 {
    color: var(--primary-color);
    margin: 1.5rem 0 0.75rem;
}

.terms-content p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.pricing-header {
    text-align: center;
    margin-bottom: 3rem;
}

.pricing-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.pricing-header p {
    font-size: 1.2rem;
    color: var(--text-light);
}

.vip-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    margin-top: 1rem;
    box-shadow: var(--shadow-md);
}

.vip-badge i {
    font-size: 1.5rem;
}

.vip-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.vip-label {
    font-weight: bold;
    font-size: 1.1rem;
}

.vip-expire {
    font-size: 0.9rem;
    opacity: 0.9;
}

.pricing-section {
    margin-bottom: 4rem;
}

.pricing-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.pricing-card {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all 0.3s;
    position: relative;
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.pricing-card.popular {
    border: 3px solid var(--primary-color);
}

.popular-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.vip-card {
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
    border: 3px solid var(--warning-color);
}

.card-header {
    padding: 2rem;
    text-align: center;
    background: var(--bg-light);
}

.vip-card .card-header {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.card-header h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
}

.currency {
    font-size: 1.5rem;
    font-weight: 600;
}

.amount {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
}

.period {
    font-size: 1rem;
    color: var(--text-light);
}

.card-body {
    padding: 2rem;
}

.features {
    list-style: none;
    margin-bottom: 2rem;
}

.features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.features li:last-child {
    border-bottom: none;
}

.features i {
    color: var(--success-color);
    font-size: 1.2rem;
}

.faq-section {
    margin-top: 4rem;
}

.faq-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
}

.faq-item h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.faq-item p {
    color: var(--text-light);
    line-height: 1.6;
}

.settings-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.settings-sidebar {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    height: fit-content;
}

.settings-sidebar h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s;
    font-weight: 500;
}

.settings-nav-item:hover {
    background: var(--bg-light);
}

.settings-nav-item.active {
    background: var(--primary-color);
    color: white;
}

.settings-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.settings-section h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.user-info-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
}

.user-avatar i {
    font-size: 5rem;
    color: var(--primary-color);
}

.user-details h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.user-details p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

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

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

.stat-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.settings-form {
    max-width: 600px;
}

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

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

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
}

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

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-card {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-color);
}

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

.order-number {
    font-weight: 600;
    color: var(--primary-color);
}

.order-status {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.order-status.paid {
    background: var(--success-color);
    color: white;
}

.order-status.pending {
    background: var(--warning-color);
    color: white;
}

.order-status.failed {
    background: var(--danger-color);
    color: white;
}

.order-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    color: var(--text-light);
}

.order-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.order-detail-label {
    font-size: 0.85rem;
}

.order-detail-value {
    font-weight: 600;
    color: var(--text-dark);
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

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

.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.site-footer {
    margin-top: auto;
    padding: 2rem 2rem 3rem;
    background: white;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-company {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.footer-contact {
    color: var(--text-light);
    font-size: 0.95rem;
}

.footer-contact a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer-contact a:hover {
    text-decoration: underline;
}

.footer-sep {
    margin: 0 0.5rem;
    color: var(--border-color);
}

.footer-legal {
    margin-top: 1rem;
    padding-bottom: 0.5rem;
    font-size: 0.9rem;
}

.footer-legal a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer-legal a:hover {
    text-decoration: underline;
}

@media (max-width: 1024px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .settings-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
    }

    .container {
        padding: 1rem;
    }

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

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

    .canvas-wrapper canvas {
        max-width: 100%;
    }
}
