/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body styles */
body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #ffffff;
    background: linear-gradient(180deg, #002855 0%, #001a33 100%); /* Deep ocean gradient */
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header styles */
header {
    background: rgba(0, 40, 85, 0.95); /* Maritime steel blue */
    padding: 1.5rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    backdrop-filter: blur(15px);
    border-bottom: 2px solid #00aaff; /* Bright maritime accent */
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.6);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-img {
    max-width: 150px; /* Default size for large screens */
    height: auto;
    margin-right: 1rem;
    object-fit: contain;
    transition: max-width 0.3s ease; /* Smooth scaling */
}

@media (min-width: 1200px) { /* Large PCs */
    .logo-img {
        max-width: 150px;
    }
}

@media (min-width: 1024px) and (max-width: 1199px) { /* Tablets */
    .logo-img {
        max-width: 120px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) { /* Smaller Tablets */
    .logo-img {
        max-width: 110px;
    }
}

@media (max-width: 767px) { /* Mobile (Android, iOS Phones) */
    .logo-img {
        max-width: 90px;
        margin-right: 0;
        margin-bottom: 0.5rem; /* Add vertical spacing on mobile */
    }
}

.text-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo h1 {
    font-family: 'Orbitron', sans-serif; /* Header Company Name Font */
    font-size: 2.5rem; /* Bigger than slogan */
    font-weight: 700;
    text-transform: none; /* Straight sentence */
    letter-spacing: 1px;
    background: linear-gradient(90deg, #00aaff, #66ccff); /* Ocean-inspired gradient */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px rgba(0, 170, 255, 0.5);
}

.slogan {
    font-family: 'Poppins', sans-serif; /* Slogan Font */
    font-size: 1.8rem; /* Smaller than company name */
    font-weight: 400;
    margin-top: 0.3rem; /* Tightened spacing */
    color: #b3d9ff;
    text-shadow: 0 0 10px rgba(0, 170, 255, 0.4);
    text-transform: none; /* Straight sentence */
    letter-spacing: 1px;
}

nav ul {
    list-style: none;
    display: flex;
}

nav ul li {
    margin-left: 3.5rem;
}

nav ul li a {
    color: #ffffff;
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    position: relative;
    transition: all 0.3s ease;
}

nav ul li a::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: #00aaff;
    bottom: -8px;
    left: 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

nav ul li a:hover::before {
    transform: scaleX(1);
}

nav ul li a:hover {
    color: #00aaff;
    text-shadow: 0 0 10px rgba(0, 170, 255, 0.7);
}

/* Hero Section with Maritime Background and Effect */
/* Fix Hero Section Overlap and ensure full visibility with balanced space below "Set Sail into Tomorrow" button */
.hero {
    background: url('images/hero-maritime.jpg') no-repeat center center/cover; /* Maritime harbor with ships */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding-top: 260px; /* Ensure "Charting the Future of Maritime Recruitment" is fully visible below header */
}

@media (max-width: 1024px) { /* Tablets and smaller devices */
    .hero {
        padding-top: 270px; /* Adjusted for tablets */
    }
}

@media (max-width: 767px) { /* Mobile phones (Android, iOS) */
    .hero {
        padding-top: 280px; /* Adjusted for mobile */
    }
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 25, 51, 0.8), rgba(0, 230, 255, 0.2));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 2rem;
    margin-bottom: 4rem; /* Reduced to balance space below the button, ensuring it’s not touching the bottom but not excessive */
}

.hero-content h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 4.5rem;
    font-weight: 700;
    text-transform: uppercase;
    background: linear-gradient(90deg, #00e6ff, #66ffcc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 230, 255, 0.8);
    animation: glowText 2s ease-in-out infinite alternate;
}

.hero-content p {
    font-size: 1.7rem;
    margin-bottom: 3rem;
    color: #b3e6ff;
    text-shadow: 0 0 10px rgba(0, 230, 255, 0.4);
    animation: fadeIn 2s ease-in-out;
}

.cta-button {
    display: inline-block;
    padding: 1.5rem 4rem;
    background: linear-gradient(135deg, #00e6ff, #0077b6);
    color: #ffffff;
    text-decoration: none;
    border-radius: 50px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    border: 2px solid #00e6ff;
    box-shadow: 0 0 30px rgba(0, 230, 255, 0.8);
    transition: all 0.4s ease;
    animation: pulse 2s infinite;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
    margin-bottom: 2rem; /* Maintain space below the button, ensuring it’s balanced */
}

.cta-button:hover {
    background: linear-gradient(135deg, #66ffcc, #00e6ff);
    transform: scale(1.1);
    box-shadow: 0 0 50px rgba(0, 230, 255, 1);
}

.hologram-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 230, 255, 0.1) 0%, rgba(0, 25, 51, 0) 70%);
    animation: hologram 10s infinite alternate;
    pointer-events: none;
}

/* Content Sections */
.content-section {
    max-width: 1300px;
    margin: 6rem auto;
    padding: 0 2rem;
    text-align: center;
    position: relative;
    display: flex; /* Ensure content is centered */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    min-height: calc(100vh - 12rem); /* Ensure vertical centering with padding */
    flex-direction: column; /* Stack content vertically for all sections */
}

/* About Section - Match exact original background with image and overlay (no changes) */
.about-section {
    background: url('https://images.unsplash.com/photo-1566842593728-b7e35e6b427a') no-repeat center center/cover;
    padding: 8rem 2rem;
    position: relative;
    overflow: hidden;
    border-radius: 25px;
    margin: 2rem auto; /* Center horizontally with auto margins */
    box-shadow: 0 0 50px rgba(0, 170, 255, 0.5); /* Match Contact section glowing effect */
    width: 100%;
    max-width: 1300px; /* Match content-section max-width for consistency */
    height: auto; /* Allow dynamic height based on content */
    display: flex; /* Use flexbox for centering */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
}

.about-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 40, 85, 0.85), rgba(0, 170, 255, 0.15));
    z-index: 1;
}

.about-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    width: 100%;
    margin: 0 auto; /* Center horizontally */
    text-align: center;
    padding: 2rem; /* Add padding for better spacing */
    display: block; /* Ensure content is block-level for centering */
}

.content-section h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5rem;
    background: linear-gradient(90deg, #00aaff, #66ccff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px rgba(0, 170, 255, 0.6);
    margin-bottom: 2rem;
    animation: slideIn 1s ease-out;
}

.content-section p {
    font-size: 1.2rem;
    color: #b3d9ff;
    text-shadow: 0 0 5px rgba(0, 170, 255, 0.3);
    animation: slideIn 1.5s ease-out;
    margin-bottom: 1rem;
}

/* Services Section */
.services-section {
    padding: 8rem 2rem;
    position: relative;
    background: radial-gradient(circle at center, rgba(0, 40, 85, 0.9) 0%, rgba(0, 26, 51, 1) 100%); /* Ocean steel */
    display: flex; /* Ensure content is centered */
    flex-direction: column; /* Stack content vertically */
    align-items: center; /* Center horizontally */
    min-height: calc(100vh - 4rem); /* Ensure vertical centering with minimal padding */
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Three cards */
    gap: 2rem;
    margin-top: 2rem;
    width: 100%;
    max-width: 1300px; /* Match content-section max-width */
    margin: 0 auto; /* Center the grid */
}

.service-card {
    background: no-repeat center center/cover; /* Background image for all service cards */
    height: 300px; /* Initial height */
    border-radius: 20px;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 170, 255, 0.5); /* Match Contact section glowing effect */
    overflow: hidden;
    border: 1px solid #00aaff;
    transition: all 0.5s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-card .card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 40, 85, 0.7), rgba(0, 170, 255, 0.2));
    z-index: 1;
    transition: opacity 0.5s ease;
}

.service-card h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: #ffffff;
    text-shadow: 0 0 15px rgba(0, 170, 255, 0.7);
    z-index: 2;
    transition: font-size 0.5s ease;
}

.service-card .card-content {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 0;
    background: rgba(0, 40, 85, 0.9);
    overflow: auto; /* Enable scrolling if text exceeds height */
    padding: 1rem;
    box-sizing: border-box;
    z-index: 2;
    transition: all 0.5s ease;
}

.service-card .card-content p {
    font-size: 1rem;
    color: #b3d9ff;
    opacity: 0;
    transition: opacity 0.5s ease;
    margin-bottom: 0.5rem;
    line-height: 1.4; /* Improve readability */
}

.service-card:hover,
.service-card:focus {
    transform: translateY(-30px) scale(1.2); /* Larger expansion */
    z-index: 3;
    height: 500px; /* Expanded height to show all text */
    width: 100%; /* Full width to accommodate text */
    margin: 0 auto; /* Center the expanded card */
}

.service-card:hover .card-overlay,
.service-card:focus .card-overlay {
    opacity: 0.5;
}

.service-card:hover .card-content,
.service-card:focus .card-content {
    height: 100%; /* Full height of expanded card */
    top: 0;
}

.service-card:hover .card-content p,
.service-card:focus .card-content p {
    opacity: 1;
}

.service-card:hover ~ .service-card,
.service-card:focus ~ .service-card {
    transform: translateY(20px) scale(0.9); /* Further backward movement */
}

/* Contact Section - Ensure centered on desktop */
.contact-section {
    padding: 8rem 2rem;
    background: linear-gradient(135deg, rgba(0, 40, 85, 0.9), rgba(0, 26, 51, 1));
    border-radius: 25px;
    margin: 2rem auto; /* Center horizontally with auto margins */
    box-shadow: 0 0 50px rgba(0, 170, 255, 0.5);
    position: relative;
    width: 100%;
    max-width: 1300px; /* Match content-section max-width for consistency */
    display: flex; /* Use flexbox for centering */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    min-height: calc(100vh - 16rem); /* Ensure vertical centering with padding */
}

.contact-info {
    max-width: 700px;
    width: 100%;
    margin: 0 auto; /* Center horizontally */
    padding: 2rem;
    background: rgba(0, 51, 102, 0.9);
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 170, 255, 0.4);
    text-align: center;
}

.contact-info p {
    margin: 1.5rem 0;
    font-size: 1.3rem;
}

.contact-info span {
    color: #00aaff;
    font-weight: 600;
}

.contact-info a {
    color: #66ccff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.contact-info a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: #66ccff;
    bottom: -5px;
    left: 0;
    transition: width 0.3s ease;
}

.contact-info a:hover::after {
    width: 100%;
}

.contact-info a:hover {
    color: #b3d9ff;
    text-shadow: 0 0 10px rgba(0, 170, 255, 0.8);
}

/* Footer */
footer {
    background: linear-gradient(135deg, #002855, #001a33);
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.6);
    border-top: 2px solid #00aaff;
}

/* Animations */
@keyframes glowText {
    0% { text-shadow: 0 0 10px rgba(0, 230, 255, 0.5); }
    100% { text-shadow: 0 0 20px rgba(0, 230, 255, 0.8); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(60px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 20px rgba(0, 230, 255, 0.8); }
    50% { box-shadow: 0 0 40px rgba(0, 230, 255, 1); }
    100% { box-shadow: 0 0 20px rgba(0, 230, 255, 0.8); }
}

@keyframes hologram {
    0% { opacity: 0.1; transform: scale(1); }
    100% { opacity: 0.3; transform: scale(1.05); }
}

/* Responsive Design for All Devices (PC, Mobile, Android, iOS, Tablets) */
@media (min-width: 1200px) { /* Large PCs */
    .hero-content h2 {
        font-size: 4.8rem;
    }
    .hero-content p {
        font-size: 1.8rem;
    }
    .content-section h2 {
        font-size: 3.8rem;
    }
    .logo-img {
        max-width: 130px;
    }
    .logo h1 {
        font-size: 2.7rem;
    }
    .slogan {
        font-size: 2rem;
    }
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .service-card {
        height: 350px;
    }
    .service-card:hover,
    .service-card:focus {
        height: 600px; /* Larger expansion on PC */
        width: 100%;
    }
    .about-section {
        min-height: calc(100vh - 12rem); /* Ensure vertical centering on large PCs */
    }
    .contact-section {
        min-height: calc(100vh - 16rem); /* Ensure vertical centering on large PCs */
    }
}

@media (min-width: 1024px) and (max-width: 1199px) { /* Tablets (iPad, Android Tablets) */
    .hero-content h2 {
        font-size: 3.5rem;
    }
    .hero-content p {
        font-size: 1.5rem;
    }
    .content-section h2 {
        font-size: 3rem;
    }
    header {
        padding: 1rem 2rem;
    }
    nav ul li {
        margin: 0 2rem;
    }
    .logo-img {
        max-width: 100px;
    }
    .logo h1 {
        font-size: 2.2rem;
    }
    .slogan {
        font-size: 1.6rem;
    }
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .service-card {
        height: 300px;
    }
    .service-card:hover,
    .service-card:focus {
        height: 500px; /* Adjusted for tablets */
        width: 100%;
    }
    .about-section {
        min-height: calc(100vh - 12rem); /* Ensure vertical centering on tablets */
    }
    .contact-section {
        min-height: calc(100vh - 16rem); /* Ensure vertical centering on tablets */
    }
}

@media (max-width: 767px) { /* Mobile (Android, iOS Phones) */
    .hero-content h2 {
        font-size: 2.2rem;
    }
    .hero-content p {
        font-size: 1.1rem;
    }
    .content-section h2 {
        font-size: 1.8rem;
    }
    .slogan {
        font-size: 1.3rem;
    }
    header {
        padding: 1rem 1rem;
        flex-direction: column;
    }
    .logo-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .logo-img {
        max-width: 70px;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    .text-container {
        align-items: center;
    }
    .logo h1 {
        font-size: 1.6rem;
    }
    nav ul {
        margin-top: 1rem;
        justify-content: center;
    }
    nav ul li {
        margin: 0 0.8rem;
    }
    .services-grid {
        grid-template-columns: 1fr; /* Stack cards vertically on mobile */
    }
    .service-card {
        height: 200px;
        margin-bottom: 1rem;
    }
    .service-card:hover,
    .service-card:focus {
        height: 400px; /* Adjusted for mobile */
        width: 100%;
        margin: 0 auto;
    }
    .cta-button {
        padding: 0.8rem 2.5rem;
        font-size: 1rem;
    }
    .about-section {
        padding: 4rem 1rem; /* Reduced padding on mobile for better fit */
        margin: 1rem auto; /* Center with smaller margins */
        min-height: auto; /* Remove min-height for mobile stacking */
    }
    .contact-section {
        padding: 4rem 1rem; /* Reduced padding on mobile for better fit */
        margin: 1rem auto; /* Center with smaller margins */
        min-height: auto; /* Remove min-height for mobile stacking */
    }
}

@media (min-width: 768px) and (max-width: 1023px) { /* Smaller Tablets (iPad Mini, Android Tablets) */
    .hero-content h2 {
        font-size: 3rem;
    }
    .hero-content p {
        font-size: 1.3rem;
    }
    .content-section h2 {
        font-size: 2.5rem;
    }
    header {
        padding: 1rem 1.5rem;
    }
    nav ul li {
        margin: 0 1.5rem;
    }
    .logo-img {
        max-width: 90px;
    }
    .logo h1 {
        font-size: 2rem;
    }
    .slogan {
        font-size: 1.5rem;
    }
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .service-card {
        height: 250px;
    }
    .service-card:hover,
    .service-card:focus {
        height: 450px; /* Adjusted for smaller tablets */
        width: 100%;
    }
    .about-section {
        min-height: calc(100vh - 12rem); /* Ensure vertical centering on smaller tablets */
    }
    .contact-section {
        min-height: calc(100vh - 16rem); /* Ensure vertical centering on smaller tablets */
    }
}