import React from 'react';
import { Youtube, Instagram, Facebook, Linkedin, MapPin, Phone, Mail, ExternalLink } from 'lucide-react';

const XLogo = ({ size = 24, className = "" }: { size?: number, className?: string }) => (
  <svg 
    xmlns="http://www.w3.org/2000/svg" 
    width={size} 
    height={size} 
    viewBox="0 0 24 24" 
    fill="currentColor"
    className={className}
  >
    <path d="M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z" />
  </svg>
);

const Footer: React.FC = () => {
  const currentYear = new Date().getFullYear();

  const footerLinks = {
    col1: [
      { name: 'About The College', href: 'https://ritchennai.org/about-chairman-message.php' },
      { name: 'News Room', href: 'https://ritchennai.org/rit-news-room.php' },
      { name: 'Governing Council', href: 'https://ritchennai.org/about-governing-council.php' },
      { name: 'Career @ RIT', href: 'https://ritchennai.org/career.php' },
      { name: 'Blog', href: 'https://ritchennai.org/blog' },
      { name: 'In alliance with Rajalakshmi Eduverse (www.myeduverse.net)', href: 'https://eduver.se/' },
      { name: 'Cancellation & Refund Policy', href: 'https://ritchennai.org/downloads/C&R-Policy.pdf' },
    ],
    col2: [
      { name: 'Courses', href: 'https://ritchennai.org/admission-courses-offered.php' },
      { name: 'Admissions', href: 'https://apply.ritchennai.org/' },
      { name: 'Eligibility', href: 'https://ritchennai.org/admission-eligibility.php' },
      { name: 'Code of Conduct - Students', href: 'https://ritchennai.org/downloads/CODE%20OF%20CONDUCT%20FOR%20STUDENTS.pdf' },
      { name: 'Online Fees Payment', href: 'https://epayments.in.worldline.com/rajalakshmi?swith=rollnumber' },
      { name: 'Terms & Conditions', href: 'https://ritchennai.org/downloads/T&C.pdf' },
      { name: 'Privacy Policy', href: 'https://ritchennai.org/downloads/Privacy-Policy.pdf' },
    ],
    col3: [
      { name: 'Library', href: 'https://ritchennai.org/facilities-library.php' },
      { name: 'Hostel', href: 'https://ritchennai.org/facilities-hostel.php' },
      { name: 'Sports', href: 'https://ritchennai.org/facilities-sports.php' },
      { name: 'Transport', href: 'https://ritchennai.org/facilities-transport.php' },
      { name: 'HR Manual', href: 'https://ritchennai.org/downloads/HR%20manual.pdf' },
      { name: 'Patent', href: 'https://ritchennai.org/downloads/document%207.01.2022.pdf' },
      { name: 'Audited Statements', href: 'https://ritchennai.org/audited-statements.php' },
      { name: 'Shopping and Delivery Conditions', href: 'https://ritchennai.org/downloads/S&D-Conditions.pdf' },
    ],
  };

  const socialLinks = [
    { icon: Facebook, href: 'https://www.facebook.com/ritchennai/', color: 'hover:text-blue-600' },
    { icon: XLogo, href: 'https://x.com/rit_chennai', color: 'hover:text-gray-900' },
    { icon: Instagram, href: 'https://www.instagram.com/ritchennai/', color: 'hover:text-pink-600' },
    { icon: Linkedin, href: 'https://www.linkedin.com/school/rajalakshmi-institute-of-technology/', color: 'hover:text-blue-700' },
    { icon: Youtube, href: 'https://youtube.com/@rajalakshmiinstituteoftech4448?si=jRmCDzp9dbwBLVQI', color: 'hover:text-red-600' },
  ];

  return (
    <footer className="bg-white pt-20 pb-10 border-t border-gray-100 font-sans text-gray-600">
      <div className="max-w-7xl mx-auto px-6 md:px-12 lg:px-24">
        <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-12 gap-12 lg:gap-8 mb-16">
          
          {/* Brand and Social */}
          <div className="lg:col-span-4 space-y-6 pr-4 lg:pr-8">
            <div className="pb-2">
              <img 
                src="/Rit-logo.png" 
                alt="RIT Logo" 
                className="h-16 w-auto object-contain mb-6"
              />
              <p className="text-sm leading-relaxed text-gray-600 text-justify">
                Established in 2008, Rajalakshmi Institute of Technology (An Autonomous Institution) is a premier engineering college in Chennai. Accredited with an A++ grade by NAAC, affiliated to Anna University, and approved by AICTE & NBA, RIT is dedicated to providing excellence in higher education.
              </p>
            </div>
            
            <div className="flex gap-4">
              {socialLinks.map((social, index) => (
                <a 
                  key={index}
                  href={social.href} 
                  target="_blank" 
                  rel="noopener noreferrer"
                  className={`w-10 h-10 rounded-full bg-gray-50 border border-gray-200 flex items-center justify-center transition-all duration-300 hover:border-transparent hover:shadow-md ${social.color} group`}
                >
                  <social.icon size={18} className="group-hover:scale-110 transition-transform" />
                </a>
              ))}
            </div>
          </div>

          {/* Links Columns */}
          <div className="lg:col-span-2 space-y-6 pt-2">
            <h3 className="text-xs font-black text-[#1e3a8a] uppercase tracking-widest border-b-2 border-[#f97316] pb-2 w-fit">
              DISCOVER RIT
            </h3>
            <ul className="space-y-4">
              {footerLinks.col1.map((link) => (
                <li key={link.name}>
                  <a href={link.href} className="text-sm font-medium hover:text-[#f97316] transition-colors leading-relaxed">{link.name}</a>
                </li>
              ))}
            </ul>
          </div>

          <div className="lg:col-span-2 space-y-6 pt-2">
            <h3 className="text-xs font-black text-[#1e3a8a] uppercase tracking-widest border-b-2 border-[#f97316] pb-2 w-fit">
              ADMISSIONS
            </h3>
            <ul className="space-y-4">
              {footerLinks.col2.map((link) => (
                <li key={link.name}>
                  <a href={link.href} className="text-sm font-medium hover:text-[#f97316] transition-colors leading-relaxed">{link.name}</a>
                </li>
              ))}
            </ul>
          </div>

          <div className="lg:col-span-2 space-y-6 pt-2">
            <h3 className="text-xs font-black text-[#1e3a8a] uppercase tracking-widest border-b-2 border-[#f97316] pb-2 w-fit">
              FACILITIES
            </h3>
            <ul className="space-y-4">
              {footerLinks.col3.map((link) => (
                <li key={link.name}>
                  <a href={link.href} className="text-sm font-medium hover:text-[#f97316] transition-colors leading-relaxed">{link.name}</a>
                </li>
              ))}
            </ul>
          </div>

          {/* Contact Info */}
          <div className="lg:col-span-2 space-y-8">
            <div className="space-y-4">
              <h3 className="text-xs font-black text-[#1e3a8a] uppercase tracking-widest border-b-2 border-[#f97316] pb-2 w-fit">
                ADDRESS
              </h3>
              <div className="space-y-4 text-[13px]">
                <div>
                  <p className="font-bold text-gray-800 mb-1">RAJALAKSHMI INSTITUTE OF TECHNOLOGY</p>
                  <p>BANGALORE HIGHWAY ROAD, KUTHAMBAKKAM</p>
                  <p>CHENNAI TAMIL NADU - 600124,</p>
                </div>
              </div>
            </div>

            <div className="space-y-4">
              <h3 className="text-xs font-black text-[#1e3a8a] uppercase tracking-widest border-b-2 border-[#f97316] pb-2 w-fit">
                PHONE
              </h3>
              <div className="text-[13px] space-y-1">
                <p>Mobile : +91 8925977445</p>
                <p>Ph : 91 44 6718 1601</p>
              </div>
            </div>

            <div className="space-y-4">
              <h3 className="text-xs font-black text-[#1e3a8a] uppercase tracking-widest border-b-2 border-[#f97316] pb-2 w-fit">
                EMAIL
              </h3>
              <a href="mailto:mail@ritchennai.edu.in" className="text-[13px] hover:text-[#f97316] transition-colors">
                mail@ritchennai.edu.in
              </a>
            </div>
          </div>

        </div>

        {/* Bottom Bar */}
        <div className="pt-10 border-t border-gray-100 flex flex-col md:flex-row justify-between items-center gap-6">
          <div className="flex items-center gap-2">
            <span className="text-[11px] font-bold text-gray-400 ml-2">© {currentYear} Rajalakshmi Institute Of Technology</span>
          </div>
          
          <div className="flex gap-8 text-[11px] font-bold uppercase tracking-widest">
            {/* Links removed as per request */}
          </div>
        </div>
      </div>
    </footer>
  );
};

export default Footer;

