-- Run this in phpMyAdmin to add new tables

CREATE TABLE IF NOT EXISTS testimonials (
    id INT AUTO_INCREMENT PRIMARY KEY,
    student_name VARCHAR(100) NOT NULL,
    destination VARCHAR(100),
    university VARCHAR(200),
    review TEXT NOT NULL,
    photo VARCHAR(500),
    avatar_color VARCHAR(30) DEFAULT '#1a56db',
    flag_emoji VARCHAR(10),
    rating TINYINT DEFAULT 5,
    sort_order INT DEFAULT 0,
    status ENUM('active','inactive') DEFAULT 'active',
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS team_members (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    role VARCHAR(100),
    bio TEXT,
    photo VARCHAR(500),
    facebook VARCHAR(300),
    linkedin VARCHAR(300),
    sort_order INT DEFAULT 0,
    status ENUM('active','inactive') DEFAULT 'active',
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS content_blocks (
    id INT AUTO_INCREMENT PRIMARY KEY,
    block_key VARCHAR(100) NOT NULL UNIQUE,
    title VARCHAR(300),
    subtitle VARCHAR(500),
    body LONGTEXT,
    image VARCHAR(500),
    button_text VARCHAR(100),
    button_url VARCHAR(300),
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

-- Add views column to blog_posts if missing
ALTER TABLE blog_posts ADD COLUMN IF NOT EXISTS views INT DEFAULT 0;

-- Default testimonials
INSERT IGNORE INTO testimonials (student_name,destination,university,review,flag_emoji,avatar_color) VALUES
('Rahim Uddin','Malta','MCAST','CY Consultancy made my Malta dream a reality! The entire process from application to visa was handled professionally.','🇲🇹','#e76f51'),
('Sumaiya Ahmed','UK','University of London','Excellent service! They helped me get into a top UK university. Highly recommended!','🇬🇧','#1a56db'),
('Karim Hossain','Canada','Toronto College','I was nervous about studying abroad but CY guided me every step. My visa was approved in record time.','🇨🇦','#059669'),
('Nadia Islam','Cyprus','University of Cyprus','From Cyprus visa to enrollment — CY handled everything flawlessly.','🇨🇾','#7c3aed'),
('Tanvir Rahman','Australia','Melbourne Institute','Best decision of my life! CY got my Australian student visa within 3 months.','🇦🇺','#d97706'),
('Fatema Khatun','Netherlands','Amsterdam University','CY helped me secure admission in Netherlands. Amazing Schengen visa expertise!','🇳🇱','#e76f51');
