/* CSS Reset & Variables */
:root {
    --primary-color: #dc2626;
    --secondary-color: #b91c1c;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --bg-light: #f9fafb;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px 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;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

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

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

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

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

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.user-dropdown {
    position: relative;
}

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

.user-btn:hover {
    background: var(--border-color);
}

.user-btn i {
    font-size: 1.2rem;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: white;
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1000;
}

.user-dropdown.open .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-color);
    text-decoration: none;
    transition: background 0.3s;
}

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

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 3rem 0;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-light);
}

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

.btn-full {
    width: 100%;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

.radio-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.radio-label span {
    line-height: 1;
}

.color-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    align-items: center;
}

.color-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    min-height: 36px;
}

.color-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
}

.color-box {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.color-option input[type="color"] {
    width: 50px;
    height: 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.color-option span {
    line-height: 1;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.checkbox-label span {
    line-height: 1;
}

/* Stamp Generator */
.stamp-generator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.generator-left h1 {
    margin-bottom: 2rem;
    color: var(--text-color);
}

.generator-left .btn-primary {
    width: 100%;
    margin-top: 0.5rem;
}

.credit-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.credit-info i {
    color: var(--warning);
    font-size: 1.3rem;
    flex-shrink: 0;
}

.credit-info span {
    line-height: 1.4;
}

/* Preview Container */
.preview-container {
    position: sticky;
    top: 100px;
}

.preview-container h2 {
    margin-bottom: 1.5rem;
}

.preview-container .btn-secondary {
    width: 100%;
}

.canvas-wrapper {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    border: 2px solid var(--border-color);
}

#stampCanvas {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
}

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

.auth-container {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    padding: 0 20px;
}

.auth-card {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.auth-card h1 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

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

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

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

.auth-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

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

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

/* Pricing Page */
.pricing-header {
    text-align: center;
    margin-bottom: 3rem;
}

.pricing-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

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

.pricing-toggle {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.toggle-btn {
    padding: 12px 32px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

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

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

.pricing-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s;
}

.pricing-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
    border-color: var(--primary-color);
    position: relative;
}

.pricing-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.pricing-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.pricing-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.pricing-price small {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 400;
}

.pricing-features {
    list-style: none;
    margin: 1.5rem 0;
}

.pricing-features li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pricing-features i {
    color: var(--success);
}

/* Settings Page */
.settings-page h1 {
    margin-bottom: 2rem;
}

.settings-grid {
    display: grid;
    gap: 2rem;
}

.settings-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
}

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

.account-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
}

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

.stat-item strong {
    display: block;
    font-size: 1.2rem;
}

.stat-item span {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Orders Page */
.orders-page h1 {
    margin-bottom: 2rem;
}

.orders-container {
    margin-bottom: 2rem;
}

.order-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

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

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

.order-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.order-status.paid {
    background: #d1fae5;
    color: #065f46;
}

.order-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.order-status.cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.order-body {
    display: grid;
    gap: 0.5rem;
}

.order-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-row strong {
    color: var(--text-color);
}

.order-row span {
    color: var(--text-light);
}

.order-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.order-empty i {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 1rem;
}

.order-empty p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.btn-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-pagination:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

/* Footer */
.footer {
    background: var(--text-color);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

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

.footer-section h3 {
    margin-bottom: 1rem;
}

.footer-section p {
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
    text-decoration: underline;
}

.footer-section i {
    margin-right: 8px;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    z-index: 9999;
    transition: bottom 0.3s;
    min-width: 300px;
    max-width: 500px;
}

.toast.show {
    bottom: 30px;
}

.toast.success {
    background: var(--success);
    color: white;
}

.toast.error {
    background: var(--error);
    color: white;
}

.toast.warning {
    background: var(--warning);
    color: white;
}

.toast.info {
    background: #3b82f6;
    color: white;
}

/* Legal Pages */
.legal-page {
    max-width: 800px;
    margin: 0 auto;
}

.legal-page h1 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.legal-update {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 3rem;
}

.legal-section {
    margin-bottom: 2.5rem;
}

.legal-section h2 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.legal-section p {
    color: var(--text-color);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.legal-section ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.legal-section li {
    color: var(--text-color);
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.legal-section strong {
    color: var(--text-color);
    font-weight: 600;
}

/* Loading Spinner */
.btn-loader {
    display: inline-block;
}

/* Code Input Group */
.code-input-group {
    display: flex;
    gap: 8px;
}

.code-input-group input {
    flex: 1;
}

.code-input-group button {
    white-space: nowrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stamp-generator {
        grid-template-columns: 1fr;
    }

    .preview-container {
        position: static;
    }

    .navbar .container {
        position: relative;
    }

    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        display: none;
        gap: 0;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 1rem;
    }

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

    .auth-card {
        padding: 2rem;
    }

    .color-group {
        grid-template-columns: 1fr;
    }

    .account-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .pricing-header h1 {
        font-size: 2rem;
    }

    .pricing-price {
        font-size: 2rem;
    }

    .auth-card {
        padding: 1.5rem;
    }
}
