/* 
   Rocawebs - Modern Dark Theme
   Variable Definitions & Reset
*/

:root {
    /* Color Palette */
    --bg-dark: #0f172a;
    /* Slate 900 */
    --bg-darker: #020617;
    /* Slate 950 */
    --bg-card: #1e293b;
    /* Slate 800 */

    --primary: #06b6d4;
    /* Cyan 500 */
    --primary-glow: rgba(6, 182, 212, 0.5);

    --secondary: #3b82f6;
    /* Blue 500 */
    --accent: #22c55e;
    /* Green 500 */

    --text-main: #f8fafc;
    /* Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */

    /* Gradients */
    --gradient-main: linear-gradient(135deg, var(--secondary), var(--primary));

    /* Spacing & Layout */
    --container-width: 1200px;
    --header-height: 80px;

    /* Typography */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Effects */
    --transition: all 0.3s ease;
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--primary-glow);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-main);
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utility Classes */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

.bg-dim {
    background-color: var(--bg-darker);
}

.highlight {
    color: var(--primary);
}

.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--gradient-main);
    color: white;
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.btn-outline {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(6, 182, 212, 0.1);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
}

/* Logo Styles */
.logo img {
    height: 20px;
    width: auto;
    transition: var(--transition);
}

.logo:hover img {
    opacity: 0.8;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-menu a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary);
}

.btn-nav {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    color: var(--text-main) !important;
}

.btn-nav:hover {
    background: var(--primary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Header / Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 60px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.section-header p {
    color: var(--text-muted);
}

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: var(--header-height);
    background-image: url('https://images.unsplash.com/photo-1542831371-29b0f74f9713?q=80&w=1920&auto=format&fit=crop');
    /* Placeholder Tech Background */
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.7) 50%, var(--bg-dark) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 25px;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.hero-btns {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Services placeholders */
.services-grid,
.portfolio-grid,
.stack-grid,
.tools-grid {
    display: grid;
    gap: 30px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background: var(--bg-darker);
        flex-direction: column;
        justify-content: center;
        transition: 0.4s ease;
        padding: 20px;
    }

    .nav-menu.active {
        left: 0;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
}

/* --- Component Styles --- */

/* Cards Base */
.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-soft), 0 0 0 1px var(--primary);
}

/* Services Grid & Cards */
.services-grid {
    /* Adjusted to fit 4 cards in a row (approx 250px each) */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.service-card {
    text-align: center;
}

.service-icon {
    width: 70px;
    height: 70px;
    background: rgba(6, 182, 212, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.8rem;
    color: var(--primary);
    transition: var(--transition);
}

.service-card:hover .service-icon {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 20px var(--primary-glow);
}

.service-card h3 {
    margin-bottom: 15px;
    font-size: 1.25rem;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.service-features {
    text-align: left;
    margin-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
}

.service-features li {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.service-features li i {
    color: var(--accent);
    margin-right: 8px;
    font-size: 0.8rem;
}

/* Portfolio Grid & Cards */
.portfolio-grid {
    /* Adjusted to fit 4 cards in a row (approx 270px each + gaps) */
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.project-card {
    padding: 0;
    overflow: hidden;
}

.project-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-img {
    transform: scale(1.05);
}

.project-content {
    padding: 25px;
}

.project-content h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tag {
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.project-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.project-links {
    display: flex;
    gap: 15px;
}

.project-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 5px;
}

.project-link:hover {
    color: var(--primary);
}

/* Stack Grid */
.stack-grid {
    /* Adjusted to fit all items in one row on desktop */
    grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
    gap: 15px;
}

.stack-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px 10px;
    /* Reduced padding */
    border-radius: 12px;
    text-align: center;
    border: 1px solid transparent;
    transition: var(--transition);
}

.stack-item:hover {
    border-color: var(--primary);
    background: rgba(6, 182, 212, 0.05);
}

.stack-item i {
    font-size: 2rem;
    /* Slightly smaller icon */
    color: var(--text-muted);
    margin-bottom: 8px;
    transition: var(--transition);
}

.stack-item:hover i {
    color: var(--primary);
}

.stack-item span {
    display: block;
    font-size: 0.8rem;
    /* Slightly smaller text */
    font-weight: 500;
}

/* Tools Grid */
.tools-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.tool-card {
    text-align: center;
}

.tool-card .btn {
    margin-top: 20px;
    width: 100%;
}

/* Testimonials */
.testimonials-slider {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.testimonial-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    position: relative;
}

.testimonial-card i {
    font-size: 2rem;
    color: var(--primary);
    opacity: 0.3;
    margin-bottom: 20px;
}

.testimonial-text {
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.testimonial-author h4 {
    margin-bottom: 2px;
    font-size: 1rem;
}

.testimonial-author span {
    font-size: 0.85rem;
    color: var(--primary);
}

/* Contact Section */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.info-icon {
    width: 50px;
    height: 50px;
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.info-content h4 {
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.info-content p,
.info-content a {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.info-content a:hover {
    color: var(--accent);
}

.contact-form form {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Footer */
.footer {
    background: var(--bg-darker);
    padding: 60px 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.footer-col h4 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: white;
}

.footer-col p {
    color: var(--text-muted);
    max-width: 300px;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: var(--text-muted);
}

.footer-col ul li a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* WhatsApp Float */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    animation: pulse-green 2s infinite;
}

.whatsapp-float:hover {
    background-color: #128c7e;
    transform: scale(1.1);
    color: white;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Modal Styles - Speed Test */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    /* High z-index */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
    visibility: hidden;
}

.modal.show {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 450px;
    padding: 40px;
    border-radius: 24px;
    position: relative;
    text-align: center;
    transform: translateY(30px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.05);
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.modal-header {
    margin-bottom: 30px;
}

.modal-header i {
    font-size: 3rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
}

.modal-header h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

/* Speed Gauge */
.speed-gauge-container {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.speed-circle {
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: var(--bg-darker);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8), 0 0 0 10px rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    position: relative;
}

.speed-circle::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.05);
    top: -12px;
    left: -12px;
    padding: 10px;
}

#speedValue {
    font-family: 'Outfit', sans-serif;
    /* Use monospaced or heading font if poss */
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    text-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

.unit {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.loader-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: var(--primary);
    border-right-color: var(--secondary);
    animation: spin 1.5s linear infinite;
    display: none;
    filter: drop-shadow(0 0 10px var(--primary));
}

.loader-ring.active {
    display: block;
}

.test-status {
    margin-bottom: 25px;
    font-size: 1.1rem;
    color: var(--text-main);
    min-height: 1.5rem;
    font-weight: 500;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 15px;
    transition: var(--transition);
}

.result-item {
    display: flex;
    flex-direction: column;
}

.result-item .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.result-item .value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
}

#startTestBtn {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* PDF Upload Area */
.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-area:hover,
.upload-area.dragover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}

.upload-area i {
    font-size: 3.5rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    transition: var(--transition);
}

.upload-area:hover i {
    color: var(--primary);
    transform: translateY(-5px);
}

.upload-area h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: var(--text-main);
}

.upload-area p {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

#pdfAnalysisResult button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}