-- Contact Messages Table
CREATE TABLE IF NOT EXISTS contact_messages (
  id INT PRIMARY KEY AUTO_INCREMENT,
  name VARCHAR(255) NOT NULL,
  email VARCHAR(255) NOT NULL,
  phone VARCHAR(50),
  subject VARCHAR(255),
  message TEXT NOT NULL,
  status ENUM('new', 'read', 'replied', 'archived') DEFAULT 'new',
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

-- Site Settings Table
CREATE TABLE IF NOT EXISTS site_settings (
  id INT PRIMARY KEY AUTO_INCREMENT,
  setting_key VARCHAR(100) UNIQUE NOT NULL,
  setting_value TEXT,
  setting_group VARCHAR(50),
  description TEXT,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

-- Insert default settings once (no overwrite on re-run)
INSERT IGNORE INTO site_settings (setting_key, setting_value, setting_group, description) VALUES
('site_phone_1', '0850 241 41 41', 'contact', 'Ana telefon numarası'),
('site_phone_2', '0216 706 50 65', 'contact', 'İkinci telefon numarası'),
('site_email', 'bilgi@ninovaturizm.com.tr', 'contact', 'İletişim e-posta adresi'),
('site_address', 'Mahmutbey Mah. Taşocağı Yolu Cad. No:1 Polat Tower&Residance Kat 24 D:188 (212 Outlet Avm bitişi) İstanbul', 'contact', 'Şirket adresi'),
('site_whatsapp', '902167065065', 'contact', 'WhatsApp numarası'),
('site_facebook', 'https://www.facebook.com/ninovaturizmizm', 'social', 'Facebook sayfası'),
('site_instagram', 'https://www.instagram.com/inanc_turizm/', 'social', 'Instagram sayfası'),
('site_youtube', '#', 'social', 'YouTube kanalı'),
('site_maps_embed', 'https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3008.945070095326!2d28.9316215!3d41.048330299999996!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x14cab1dd73091cab%3A0x8bebaeea8dded4dd!2sNinova%20TUR%C4%B0ZM!5e0!3m2!1str!2str!4v1772710670797!5m2!1str!2str', 'contact', 'Google Maps embed URL'),
('site_company_name', 'İnançtur Turizm', 'general', 'Şirket adı'),
('site_license_number', '7677', 'general', 'TURSAB belge numarası'),
('site_copyright', 'Copyright 2012-2025. Tüm haklarımız saklıdır.', 'general', 'Telif hakkı metni');
