<?php
/**
 * Mystic Art Tattoo — application configuration.
 * Copy sensible defaults; override per-environment via env vars if needed.
 */

return [
    // 'json' now, 'mysql' later (phase 2)
    'data_driver' => getenv('MAT_DATA_DRIVER') ?: 'json',

    'data_path'     => __DIR__ . DIRECTORY_SEPARATOR . 'data',
    // Uploads live in public/ so they can be served directly.
    'upload_path'   => __DIR__ . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . 'uploads',
    'upload_url'    => 'uploads',

    'app' => [
        'name'     => 'Mystic Art Tattoo',
        'base_url' => getenv('MAT_BASE_URL') ?: '',
        'env'      => getenv('MAT_ENV') ?: 'production',
        'debug'    => (getenv('MAT_DEBUG') !== '0'),
        'timezone' => 'America/New_York',
    ],

    'locale' => [
        'default'   => 'en',
        'supported' => ['en', 'es'],
    ],

    'session' => [
        'name'     => 'matsid',
        'lifetime' => 60 * 60 * 8,
        'secure'   => false, // set true in production (HTTPS)
        'httponly' => true,
        'samesite' => 'Lax',
    ],

    'mail' => [
        'from_email' => getenv('MAT_MAIL_FROM') ?: 'bebelloalex@gmail.com',
        'from_name'  => 'Mystic Art Tattoo',
        // Notification email: where copies of forms, booking alerts, etc. are BCC'd
        'notify_email' => getenv('MAT_NOTIFY_EMAIL') ?: 'bebelloalex@gmail.com',
        'smtp' => [
            'host'     => getenv('MAT_SMTP_HOST') ?: 'smtp.gmail.com',
            'port'     => (int)(getenv('MAT_SMTP_PORT') ?: 587),
            'username' => getenv('MAT_SMTP_USER') ?: 'bebelloalex@gmail.com',
            // Gmail app passwords are 16 chars without spaces; spaces are stripped on read.
            'password' => str_replace(' ', '', getenv('MAT_SMTP_PASS') ?: 'lpya bmeo dwnl idzx'),
            'secure'   => getenv('MAT_SMTP_SECURE') ?: 'tls',
        ],
    ],

    'security' => [
        'rate_limit_attempts' => 5,
        'rate_limit_window'   => 15 * 60,
    ],
];
