/* Cranston Engineering - Universal Stylesheet */
:root {
    --white: #ffffff;
    --black: #0a0a0a;
    --steel: #434952;
    --gunmetal: #2c3037;
    --chrome: #e8e9eb;
    --silver: #c0c5ce;
    --dark-silver: #8b919c;
    --red-accent: #ff0037;
    --orange-accent: #ff6b00;
    --grid-color: rgba(255, 255, 255, 0.03);
    --tech-blue: #00d4ff;
    --heading-font: 'Orbitron', sans-serif;
    --body-font: 'Rajdhani', sans-serif;
    --accent-font: 'Bebas Neue', sans-serif;
    --nav-height: 90px;
    --transition-fast: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 15px rgba(0,0,0,0.3);
    --shadow-md: 0 10px 40px rgba(0,0,0,0.4);
    --shadow-lg: 0 20px 80px rgba(0,0,0,0.5);
}

/* --- General Styles & Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--body-font);
    color: var(--chrome);
    background-color: var(--black);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* Prevent scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Industrial Grid Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Sections */
section {
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-weight: 900;
    color: var(--chrome);
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 2px;
}

h1 {
    font-size: clamp(2.8rem, 5.5vw, 4.5rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--chrome) 0%, var(--silver) 50%, var(--chrome) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255,255,255,0.3);
    margin-bottom: 20px;
}

h2 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    text-align: center;
    margin-bottom: 70px;
    position: relative;
}

h2 .accent {
    color: var(--red-accent);
    text-shadow: 0 0 20px rgba(255,0,55,0.5);
}

p {
    font-size: 1.1rem;
    color: var(--silver);
    line-height: 1.8;
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 18px 45px;
    font-family: var(--heading-font);
    font-weight: 700;
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    background: transparent;
    color: var(--chrome);
    border: 2px solid var(--red-accent);
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 30%, 100% 100%, 20px 100%, 0 70%);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--red-accent);
    transition: left var(--transition-fast);
    z-index: -1;
}

.btn:hover::before {
    left: 0;
}

.btn:hover {
    color: var(--black);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255,0,55,0.4);
}

/* --- Header & Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: linear-gradient(180deg, rgba(10,10,10,0.95) 0%, rgba(10,10,10,0.8) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    transition: all var(--transition-fast);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
    background: rgba(10,10,10,0.98);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.navbar-logo img {
    height: 60px;
    transition: all var(--transition-fast);
}

/* Hamburger Menu Styles */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 35px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
    position: relative;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background: var(--chrome);
    transition: all var(--transition-fast);
    position: relative;
}

/* Hamburger animation */
.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
    background: var(--red-accent);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
    background: var(--red-accent);
}

.nav-menu {
    display: flex;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 40px;
    align-items: center;
}

.nav-links a {
    font-family: var(--heading-font);
    color: var(--silver);
    text-decoration: none;
    position: relative;
    padding: 10px 0;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.nav-links a:hover {
    color: var(--chrome);
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--gunmetal);
    min-width: 200px;
    box-shadow: var(--shadow-md);
    z-index: 1;
    border-top: 2px solid var(--red-accent);
}

.dropdown-content a {
    color: var(--silver);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}

.dropdown-content a:hover {
    background-color: var(--red-accent);
    color: var(--white);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        flex-direction: column;
        background: linear-gradient(135deg, rgba(10,10,10,0.98) 0%, rgba(28,30,37,0.98) 100%);
        width: 100%;
        height: 100vh;
        text-align: center;
        transition: all var(--transition-smooth);
        padding-top: var(--nav-height);
        overflow-y: auto;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    
    .nav-menu.active {
        left: 0;
        box-shadow: var(--shadow-lg);
    }
    
    .nav-links {
        flex-direction: column;
        gap: 0;
        width: 100%;
        padding: 40px 0;
    }
    
    .nav-links li {
        width: 100%;
        position: relative;
    }
    
    .nav-links a {
        display: block;
        padding: 20px 30px;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        position: relative;
        overflow: hidden;
    }
    
    .nav-links a::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: 4px;
        background: var(--red-accent);
        transform: translateX(-10px);
        transition: transform var(--transition-fast);
    }
    
    .nav-links a:hover::before {
        transform: translateX(0);
    }
    
    .dropdown-content {
        display: none;
        position: static;
        background-color: rgba(67,73,82,0.3);
        box-shadow: none;
        border-top: none;
        margin-top: 0;
    }
    
    .dropdown.active .dropdown-content {
        display: block;
    }
    
    .dropdown-content a {
        padding: 15px 50px;
        font-size: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.03);
    }
    
    .dropdown > a::after {
        content: '+';
        float: right;
        font-size: 1.2rem;
        transition: transform var(--transition-fast);
    }
    
    .dropdown.active > a::after {
        transform: rotate(45deg);
    }
}

/* Add tech animation to mobile menu */
@media (max-width: 768px) {
    .nav-menu.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 2px;
        background: linear-gradient(90deg, transparent, var(--red-accent), transparent);
        animation: scanLine 3s linear infinite;
    }
    
    @keyframes scanLine {
        0% { transform: translateY(0); }
        100% { transform: translateY(100vh); }
    }
}

/* JavaScript for dropdown toggle on mobile */
@media (max-width: 768px) {
    .dropdown > a {
        cursor: pointer;
    }
}

/* --- Hero Section --- */
#hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding-top: var(--nav-height);
    background: var(--black);
    overflow: hidden;
}

.hero-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-slideshow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(10,10,10,0.8) 0%, rgba(10,10,10,0.5) 50%, rgba(10,10,10,0.9) 100%);
    z-index: 2;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: slideAnimation 20s infinite;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide:nth-child(1) { animation-delay: 0s; }
.slide:nth-child(2) { animation-delay: 5s; }
.slide:nth-child(3) { animation-delay: 10s; }
.slide:nth-child(4) { animation-delay: 15s; }

@keyframes slideAnimation {
    0% { opacity: 0; transform: scale(1.1); }
    12.5% { opacity: 1; transform: scale(1); }
    25% { opacity: 1; transform: scale(1); }
    37.5% { opacity: 0; transform: scale(1.05); }
    100% { opacity: 0; transform: scale(1.1); }
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 900px;
}

.hero-content h1 {
    font-size: 2.5rem;
    color: var(--white);
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 20px auto 40px;
}

/* Tech Elements */
.tech-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.tech-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, var(--tech-blue), transparent);
    opacity: 0.3;
}

.tech-line:nth-child(1) {
    width: 2px;
    height: 100%;
    left: 10%;
    animation: lineMove 10s linear infinite;
}

.tech-line:nth-child(2) {
    width: 100%;
    height: 2px;
    top: 20%;
    animation: lineMove 15s linear infinite reverse;
}

.tech-line:nth-child(3) {
    width: 2px;
    height: 100%;
    right: 15%;
    animation: lineMove 12s linear infinite;
}

@keyframes lineMove {
    0%, 100% { transform: translateY(-100%); }
    50% { transform: translateY(100%); }
}

/* Hero Badge */
.hero-badge {
    position: absolute;
    top: 100px;
    right: 20px;
    width: 150px;
    height: 150px;
    z-index: 4;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.hero-badge img {
    transform: translateY(110px);
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(255,255,255,0.3));
}


/* --- Services Section --- */
#home-services {
    background: var(--black);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    text-align: center;
}

.service-tile {
    background: var(--gunmetal);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all var(--transition-fast);
    overflow: hidden;
    text-decoration: none;
    color: var(--chrome);
}

.service-tile:hover {
    transform: translateY(-10px);
    border-color: var(--red-accent);
    box-shadow: 0 10px 30px rgba(255,0,55,0.2);
}

.service-tile img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-fast);
}

.service-tile:hover img {
    transform: scale(1.05);
}

.service-tile-content {
    padding: 30px;
}

.service-tile h3 {
    font-family: var(--accent-font);
    font-size: 1.8rem;
    color: var(--red-accent);
    margin-bottom: 10px;
}

.service-tile p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--silver);
    margin: 0;
}

/* --- Why Choose Us Section --- */
#why-choose-us {
    background: var(--black);
    padding-top: 50px;
}

.why-us-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.why-us-item {
    background: rgba(44, 48, 55, 0.5);
    padding: 30px;
    border-left: 4px solid var(--red-accent);
}

.why-us-item h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--chrome);
}

/* --- About & Service Page Specifics --- */
.page-header {
    padding-top: calc(var(--nav-height) + 60px);
    padding-bottom: 60px;
    text-align: center;
    background: linear-gradient(135deg, var(--gunmetal) 0%, var(--steel) 100%);
}

.page-header h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
}

.content-section {
    padding: 80px 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 50px;
    align-items: center;
}

@media (min-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr 1fr;
    }
    .content-wrapper.reverse {
        grid-template-columns: 1fr 1fr;
    }
    .content-wrapper.reverse .content-image {
        order: 2;
    }
    .content-wrapper.reverse .content-text {
        order: 1;
    }
}

.content-image img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    border: 2px solid var(--red-accent);
}

/* --- Contact Section --- */
#contact {
    background: var(--gunmetal);
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 50px;
}

@media (min-width: 992px) {
    .contact-wrapper {
        grid-template-columns: 1fr 1fr;
    }
}

.contact-form h3, .contact-info h3 {
    font-family: var(--accent-font);
    font-size: 2rem;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

/* Updated to style all inputs, textareas, and selects */
.contact-form input,
.contact-form textarea,
.contact-form select {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid rgba(255,255,255,0.1);
    background: rgba(10,10,10,0.5);
    font-family: var(--body-font);
    font-size: 1rem;
    color: var(--chrome);
    transition: all var(--transition-fast);
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
    outline: none;
    border-color: var(--red-accent);
    box-shadow: 0 0 15px rgba(255,0,55,0.2);
}

/* NEW and improved styles for the file input */
.file-upload-label {
    display: block;
    color: var(--silver);
    margin-bottom: 10px;
    font-size: 1rem;
}

.contact-form input[type="file"] {
    padding: 10px; /* Adjust padding for file input */
}

/* Style the file input button consistently */
.contact-form input[type="file"]::-webkit-file-upload-button {
    background: var(--steel);
    color: var(--chrome);
    border: none;
    padding: 10px 15px;
    border-radius: 3px;
    font-family: var(--body-font);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.contact-form input[type="file"]::-webkit-file-upload-button:hover {
    background: var(--red-accent);
}


/* --- Footer --- */
footer {
    background: var(--black);
    color: var(--silver);
    padding: 60px 0 30px;
    text-align: center;
    border-top: 2px solid var(--red-accent);
}

.footer-badge {
    margin-bottom: 40px;
}

.footer-badge img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(255,255,255,0.2));
}

.footer-contact p {
    margin-bottom: 10px;
    font-size: 1rem;
}

.copyright {
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 30px;
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .hero-badge {
        width: 120px;
        height: 120px;
        top: 90px;
        right: 10px;
    }
}

@media (max-width: 768px) {
    .hero-badge {
        display: none; /* Hide badge on small screens to avoid clutter */
    }
    
    .footer-badge img {
        width: 120px;
        height: 120px;
    }
    
    section {
        padding: 60px 0;
    }
    
    h1 {
        font-size: clamp(2rem, 5vw, 3rem);
    }
    
    h2 {
        font-size: clamp(2rem, 4vw, 2.5rem);
        margin-bottom: 40px;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 15px 35px;
        font-size: 0.85rem;
    }
}