/* styles/main.css - Global Styles */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Kanit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: #f8fafc;
    overflow-x: hidden;
}

/* ===== VARIABLES ===== */
:root {
    /* Colors */
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #48bb78;
    --danger: #f56565;
    --warning: #ed8936;
    --info: #4299e1;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f7fafc 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 25px rgba(0,0,0,0.2);
    --shadow-xl: 0 12px 40px rgba(0,0,0,0.25);
    
    /* Spacing */
    --container-max: 1200px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 20px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

/* ===== UTILITIES ===== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    min-width: 120px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

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

.btn-primary:active {
    transform: translateY(0);
}

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

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

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

.btn-danger:hover:not(:disabled) {
    background: #e53e3e;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Button Loading State */
.btn .btn-loader {
    animation: spin 1s linear infinite;
}

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

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 16px;
    transition: var(--transition);
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input:invalid:not(:placeholder-shown) {
    border-color: var(--danger);
}

.form-group input:valid:not(:placeholder-shown) {
    border-color: var(--success);
}

/* ===== LANDING PAGE ===== */
.landing {
    min-height: 100vh;
    position: relative;
}

.landing-bg {
    background: var(--gradient-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

.landing-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* ===== HERO SECTION ===== */
.hero {
    padding: 80px 0 120px;
    position: relative;
    z-index: 1;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-text {
    color: white;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 24px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    margin-bottom: 40px;
    opacity: 0.95;
    line-height: 1.6;
}

.hero-features {
    margin-bottom: 40px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.feature-icon {
    font-size: 1.5rem;
    min-width: 32px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.hero-illustration {
    position: relative;
    width: 300px;
    height: 300px;
}

.ai-assistant {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.ai-face {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: var(--shadow-lg);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.chat-bubble {
    position: absolute;
    background: white;
    padding: 16px 20px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    font-size: 0.9rem;
    max-width: 180px;
    animation: bubble-appear 2s ease-in-out infinite alternate;
}

.bubble-1 {
    top: 20px;
    right: 20px;
    color: var(--primary);
    transform: rotate(-5deg);
}

.bubble-2 {
    bottom: 40px;
    left: 10px;
    color: var(--success);
    transform: rotate(3deg);
    animation-delay: 1s;
}

@keyframes bubble-appear {
    0% { opacity: 0.7; transform: scale(0.95) rotate(-5deg); }
    100% { opacity: 1; transform: scale(1) rotate(-5deg); }
}

.bubble-2 {
    animation-name: bubble-appear-2;
}

@keyframes bubble-appear-2 {
    0% { opacity: 0.7; transform: scale(0.95) rotate(3deg); }
    100% { opacity: 1; transform: scale(1) rotate(3deg); }
}

/* ===== FEATURES SECTION ===== */
.features {
    padding: 80px 0;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    margin-top: -40px;
    position: relative;
    z-index: 1;
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 600;
    color: white;
    margin-bottom: 60px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

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

.feature-card {
    background: var(--gradient-card);
    padding: 40px 32px;
    border-radius: var(--border-radius-lg);
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.2);
}

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

.feature-icon-large {
    font-size: 3rem;
    margin-bottom: 24px;
    display: block;
}

.feature-card h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--primary-dark);
}

.feature-card p {
    color: #6b7280;
    line-height: 1.6;
}

/* ===== TOAST NOTIFICATION ===== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    z-index: 1000;
    transform: translateX(-50%) translateY(-80px);
    transition: all 0.3s ease-out;
    opacity: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-content {
    background: white;
    padding: 16px 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid var(--info);
    min-width: 300px;
}

.toast.success .toast-content {
    border-left-color: var(--success);
}

.toast.error .toast-content {
    border-left-color: var(--danger);
}

.toast.warning .toast-content {
    border-left-color: var(--warning);
}

.toast-icon {
    font-size: 1.2rem;
    min-width: 20px;
}

.toast-message {
    font-weight: 500;
}

/* ===== DEVELOPER FOOTER ===== */
.developer-footer {
    margin-top: 80px;
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.developer-info {
    color: rgba(255, 255, 255, 0.9);
}

.developer-title {
    font-size: 0.9rem;
    margin-bottom: 8px;
    opacity: 0.8;
}

.developer-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.developer-org {
    font-size: 0.95rem;
    margin-bottom: 8px;
    opacity: 0.9;
}

.developer-email a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.developer-email a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    /* Remove body margins on mobile */
    body {
        margin: 0;
        padding: 0;
        width: 100%;
        font-size: 16px;
        line-height: 1.7;
    }
    
    .landing {
        width: 100%;
        overflow-x: hidden;
    }
    
    .landing-bg {
        width: 100%;
        padding: 0;
    }
    
    .container {
        padding: 0 16px;
        width: 100%;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .hero {
        padding: 40px 0 60px;
        width: 100%;
    }
    
    .hero-buttons {
        justify-content: center;
        width: 100%;
        padding: 0 10px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .features {
        padding: 40px 0;
        width: 100%;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 0 10px;
    }
    
    .feature-card {
        padding: 32px 24px;
    }
    
    .feature-card p {
        font-size: 16px;
        line-height: 1.6;
    }
    
    .hero-illustration {
        width: 250px;
        height: 250px;
    }
    
    .chat-bubble {
        font-size: 0.8rem;
        max-width: 140px;
        padding: 12px 16px;
    }
    
    .ai-face {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .toast-content {
        min-width: 280px;
    }
    
    /* Developer footer mobile styles */
    .developer-footer {
        margin-top: 40px;
        padding: 30px 15px;
        width: 100%;
    }
    
    .developer-info {
        font-size: 0.85rem;
    }
    
    .developer-name {
        font-size: 1rem;
    }
    
    .developer-org {
        font-size: 0.9rem;
    }
    
    /* Ensure full width on mobile */
    .auth-section {
        width: 100%;
        left: 0;
        right: 0;
    }
    
    /* Hero image adjustments */
    .hero-image {
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
    }
    
    .toast {
        right: 16px;
        left: 16px;
    }
    
    .toast-content {
        min-width: auto;
    }
}