<?php
/**
 * DWSK Backend Configuration
 * ---------------------------------------------------------------
 * Compatible with PHP 8.2+ (tested for Truehost cPanel shared hosting).
 *
 * IMPORTANT: Edit the values in this file before going live.
 * Do NOT commit real SMTP passwords to public version control.
 */

// Prevent direct access to this file
if (!defined('DWSK_APP')) {
    http_response_code(403);
    exit('Direct access not permitted.');
}

// ---------------------------------------------------------------
// Site / Company details
// ---------------------------------------------------------------
define('SITE_NAME', 'Dynamic Writing Services-Kenya');
define('SITE_URL', 'https://dynamicwritingservices.com'); // no trailing slash
define('SITE_LOGO_URL', SITE_URL . '/assets/dwsk-logo.png'); // upload the provided logo here
define('BRAND_NAVY', '#0B1F3A');
define('BRAND_EMERALD', '#16A34A');

// ---------------------------------------------------------------
// Recipient (admin) emails
// ---------------------------------------------------------------
define('ADMIN_EMAIL_ORDERS', 'orders@dynamicwritingservices.com');
define('ADMIN_EMAIL_CAREERS', 'careers@dynamicwritingservices.com');
define('ADMIN_EMAIL_CONTACT', 'info@dynamicwritingservices.com');

// ---------------------------------------------------------------
// SMTP configuration (used by PHPMailer if available/configured)
// ---------------------------------------------------------------
// Leave SMTP_HOST as 'smtp.example.com' to automatically fall back
// to PHP's native mail() function until you configure real SMTP.
define('SMTP_ENABLED', false);          // set to true once SMTP_HOST etc. below are filled in
define('SMTP_HOST', 'smtp.example.com');
define('SMTP_PORT', 587);
define('SMTP_SECURE', 'tls');           // 'tls' or 'ssl'
define('SMTP_USERNAME', 'no-reply@dynamicwritingservices.com');
define('SMTP_PASSWORD', 'CHANGE_ME');
define('SMTP_FROM_EMAIL', 'no-reply@dynamicwritingservices.com');
define('SMTP_FROM_NAME', 'Dynamic Writing Services-Kenya');

// ---------------------------------------------------------------
// Upload settings
// ---------------------------------------------------------------
define('UPLOAD_DIR_ORDERS', __DIR__ . '/../uploads/orders/');
define('UPLOAD_DIR_CAREERS', __DIR__ . '/../uploads/careers/');
define('ALLOWED_EXTENSIONS', ['pdf', 'doc', 'docx']);
define('ALLOWED_MIME_TYPES', [
    'application/pdf',
    'application/msword',
    'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
    'application/x-empty', // some servers report this for edge-case uploads; extension+size still enforced
]);
define('MAX_FILE_SIZE_BYTES', 10 * 1024 * 1024); // 10 MB per file
define('MAX_FILES_PER_SUBMISSION', 6);

// ---------------------------------------------------------------
// Anti-spam / security
// ---------------------------------------------------------------
define('HONEYPOT_FIELD', 'website_url');     // must match the hidden field name in the HTML forms
define('RATE_LIMIT_WINDOW_SECONDS', 60);     // time window
define('RATE_LIMIT_MAX_SUBMISSIONS', 3);     // max submissions per IP per window
define('RECAPTCHA_ENABLED', false);          // set true once keys below are filled in
define('RECAPTCHA_SECRET_KEY', '');          // your reCAPTCHA v2/v3 secret key

// ---------------------------------------------------------------
// Logging (flat-file, no database required)
// ---------------------------------------------------------------
define('LOG_DIR', __DIR__ . '/../logs/');
define('LOG_FILE_ORDERS', LOG_DIR . 'orders.log');
define('LOG_FILE_CAREERS', LOG_DIR . 'careers.log');
define('LOG_FILE_CONTACT', LOG_DIR . 'contact.log');
define('LOG_FILE_ERRORS', LOG_DIR . 'errors.log');
define('RATE_LIMIT_STORE', LOG_DIR . 'ratelimit.json');
define('COUNTER_DIR', LOG_DIR . 'counters/');
