/* WebMix.dev Platform CSS - White Theme */
:root {
    --blue-dark: #1e40af;
    --blue-mid: #2563eb;
    --blue-light: #3b82f6;
    --cyan: #06b6d4;
    --teal: #14b8a6;
    --gradient: linear-gradient(135deg, #2563eb 0%, #06b6d4 50%, #14b8a6 100%);
    --gradient-btn: linear-gradient(135deg, #2563eb, #06b6d4);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --success: #10b981;
    --error: #ef4444;
}

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

body {
    font-family: "Inter", "Noto Sans Thai", -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Auth Pages (Login/Register) */
.auth-page {
    background: linear-gradient(135deg, var(--bg-white) 0%, var(--bg-light) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
}
.auth-page::before {
    content: "";
    position: absolute;
    top: -20%; right: -10%;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(6,182,212,0.08) 0%, transparent 70%);
    border-radius: 50%;
}
.auth-page::after {
    content: "";
    position: absolute;
    bottom: -10%; left: -10%;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(37,99,235,0.06) 0%, transparent 70%);
    border-radius: 50%;
}

.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 680px;
}

.auth-card {
    background: var(--bg-white);
    border-radius: 24px;
    padding: 48px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    margin-bottom: 24px;
}
.auth-header .logo img {
    height: 48px;
}
.auth-header .logo i {
    font-size: 1.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.auth-header .logo span {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.auth-form label i {
    color: var(--blue-mid);
    margin-right: 6px;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="url"],
.auth-form textarea,
.auth-form select {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    background: var(--bg-white);
}
.auth-form input:focus,
.auth-form textarea:focus,
.auth-form select:focus {
    border-color: var(--blue-mid);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.btn-submit {
    width: 100%;
    padding: 16px;
    background: var(--gradient-btn);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 14px rgba(37,99,235,0.25);
}
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,99,235,0.35);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.auth-footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.auth-footer a {
    color: var(--blue-mid);
    text-decoration: none;
    font-weight: 600;
}
.auth-footer a:hover {
    text-decoration: underline;
}

/* Platform Nav */
.platform-nav {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}
.platform-nav .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.platform-nav .logo img {
    height: 40px;
}
.platform-nav .logo i {
    font-size: 1.3rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.platform-nav .logo span {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}
.user-badge i {
    font-size: 1.2rem;
    color: var(--blue-mid);
}

.btn-outline {
    padding: 10px 20px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.btn-outline:hover {
    border-color: var(--blue-mid);
    color: var(--blue-mid);
}
.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-primary {
    padding: 10px 24px;
    background: var(--gradient-btn);
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 14px rgba(37,99,235,0.25);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,99,235,0.35);
}

/* Dashboard */
.dashboard {
    display: flex;
    min-height: calc(100vh - 73px);
}

.dash-sidebar {
    width: 260px;
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    padding: 32px 24px;
    flex-shrink: 0;
}
.dash-sidebar h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dash-sidebar ul {
    list-style: none;
}
.dash-sidebar li {
    margin-bottom: 4px;
}
.dash-sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s;
}
.dash-sidebar a:hover {
    background: var(--bg-light);
    color: var(--blue-mid);
}
.dash-sidebar li.active a {
    background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(6,182,212,0.1));
    color: var(--blue-mid);
    font-weight: 600;
}
.dash-sidebar a i {
    width: 20px;
    text-align: center;
}

.dash-content {
    flex: 1;
    padding: 32px 40px;
    background: var(--bg-light);
}
.dash-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.dash-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.dash-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all 0.3s;
}
.dash-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.dash-card-icon {
    width: 52px;
    height: 52px;
    background: var(--gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    flex-shrink: 0;
}
.dash-card-icon.edit {
    background: linear-gradient(135deg, #f59e0b, #f97316);
}
.dash-card-icon.domain {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
}

.dash-card-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.dash-card-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.dash-card-info .site-link {
    color: var(--blue-mid);
    text-decoration: none;
    font-size: 0.9rem;
    word-break: break-all;
}
.dash-card-info .site-link:hover {
    text-decoration: underline;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--gradient-btn);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

/* Generation Status */
.gen-status {
    background: var(--gradient);
    color: #fff;
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    animation: pulse-bg 2s infinite;
}
.gen-status.done {
    background: linear-gradient(135deg, #059669, #10b981);
    animation: none;
}

/* AI Badge */
.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--gradient);
    color: #fff;
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    margin-left: 8px;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}
.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    transition: all 0.3s;
}
.step-dot.active {
    background: var(--gradient-btn);
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

/* Buttons */
.btn-next, .btn-back {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s;
}
.btn-next {
    background: var(--gradient-btn);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37,99,235,0.25);
}
.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,99,235,0.35);
}
.btn-back {
    background: var(--bg-light);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-back:hover {
    background: var(--border);
}

/* Site Types Grid */
.site-types {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 12px;
}
.site-type-card {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-white);
}
.site-type-card:hover {
    border-color: var(--cyan);
    background: rgba(6,182,212,0.05);
}
.site-type-card.selected {
    border-color: var(--blue-mid);
    background: rgba(37,99,235,0.08);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.site-type-card i {
    font-size: 1.8rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    margin-bottom: 10px;
}
.site-type-card span {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Description Box */
.description-box textarea {
    width: 100%;
    min-height: 200px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.8;
    resize: vertical;
    transition: all 0.2s;
}
.description-box textarea:focus {
    border-color: var(--blue-mid);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Reference URL Section */
.ref-url-section {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(6,182,212,0.08), rgba(20,184,166,0.08));
    border: 1.5px solid rgba(6,182,212,0.3);
    border-radius: 14px;
}
.ref-url-section label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--teal);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.ref-url-section small {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 8px;
    display: block;
}

/* Generating Overlay */
.generating-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.95);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
}
.generating-overlay.show {
    display: flex;
}

.gen-card {
    background: var(--bg-white);
    border-radius: 24px;
    padding: 48px;
    text-align: center;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
}

.gen-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid var(--border);
    border-top-color: var(--blue-mid);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

.gen-text {
    color: var(--text-primary);
    margin-top: 24px;
    font-size: 1.25rem;
    font-weight: 700;
}

.gen-sub {
    color: var(--text-secondary);
    margin-top: 8px;
    font-size: 0.9rem;
}

.gen-progress-wrap {
    margin-top: 28px;
}

.gen-progress-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-light);
    border-radius: 5px;
    overflow: hidden;
}

.gen-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient);
    border-radius: 5px;
    transition: width 0.5s ease;
}

.gen-progress-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 8px;
    text-align: right;
    font-weight: 600;
}

.gen-steps {
    margin-top: 24px;
    text-align: left;
}

.gen-step-item {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.gen-step-item i {
    width: 18px;
    font-size: 0.75rem;
}
.gen-step-item.active {
    color: var(--blue-mid);
    font-weight: 600;
}
.gen-step-item.done {
    color: var(--success);
}
.gen-step-item.done i:before {
    content: "\f00c";
    font-weight: 900;
}

.gen-activity {
    margin-top: 20px;
    padding: 14px 18px;
    background: rgba(37,99,235,0.08);
    border-left: 4px solid var(--blue-mid);
    border-radius: 0 10px 10px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-height: 24px;
    font-family: inherit;
}

/* File Items */
.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-top: 8px;
    font-size: 0.85rem;
}
.file-item .remove-file {
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 1rem;
    padding: 0 4px;
}

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes pulse-bg {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* Responsive */
@media (max-width: 768px) {
    .auth-card {
        padding: 32px 24px;
    }
    .site-types {
        grid-template-columns: repeat(3, 1fr);
    }
    .dashboard {
        flex-direction: column;
    }
    .dash-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 20px;
    }
    .dash-sidebar ul {
        display: flex;
        gap: 8px;
        overflow-x: auto;
    }
    .dash-sidebar li {
        margin-bottom: 0;
    }
    .dash-content {
        padding: 24px 20px;
    }
}
@media (max-width: 480px) {
    .site-types {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Dashboard sections */
.dash-section {
    background: #fff;
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
}
.dash-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dash-section h2 i {
    color: #2563eb;
    font-size: 1rem;
}
.domain-form {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}
.domain-form .form-group {
    flex: 1;
    min-width: 250px;
}
.domain-form .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 6px;
}
.domain-form .form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #f8fafc;
}
.domain-form .form-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    background: #fff;
}
.domain-form .form-group small {
    display: block;
    margin-top: 6px;
    font-size: 0.78rem;
    color: #94a3b8;
}
.domain-form .btn-submit {
    padding: 12px 24px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}
.domain-form .btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

/* Account info section */
.dash-section table {
    width: 100%;
    border-collapse: collapse;
}
.dash-section table td {
    padding: 10px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}
.dash-section table td:first-child {
    font-weight: 500;
    color: #64748b;
    width: 120px;
}
.dash-section table td:last-child {
    color: #1e293b;
}
.dash-section table tr:last-child td {
    border-bottom: none;
}
