/* ===================================
   ParryApplications Portfolio Website
   Modern, Professional Design
   =================================== */

/* ===== CSS Variables ===== */
:root {
    --primary-color: #6366f1;
    --secondary-color: #ec4899;
    --accent-color: #f59e0b;
    --dark-bg: #1f2937;
    --light-bg: #f9fafb;
    --text-dark: #111827;
    --text-light: #6b7280;
    --white: #ffffff;
    --success: #10b981;
    --error: #ef4444;
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Fix for better text visibility on gradient backgrounds */
.hero p,
.services-hero p,
.portfolio-hero p,
.about-hero p {
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape on iOS */
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
}

/* Responsive image containers */
.portfolio-image,
.project-detail img {
    width: 100%;
    object-fit: cover;
    object-position: center;
}

/* Profile image specific styling */
.profile-image {
    display: block;
    margin: 0 auto;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

/* ===== Preloader ===== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-lg);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.logo img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    background: var(--light-bg);
    color: var(--primary-color);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: var(--transition);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    padding-top: 80px;
    text-align: center;
}

/* Shorter hero sections for inner pages */
.portfolio-hero,
.services-hero,
.about-hero {
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    padding: 120px 2rem 40px;
    text-align: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/slider1.jpg') center/cover;
    opacity: 0.1;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--white);
    max-width: 900px;
    padding: 2rem;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
    animation: fadeInUp 1s ease 0.2s backwards;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.8);
    animation: fadeInUp 1s ease 0.4s backwards;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.6s backwards;
}

/* Button groups spacing */
.hero-buttons .btn,
.about-hero .btn {
    margin: 0.5rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    background: var(--light-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-outline:hover {
    background: var(--white);
    color: var(--primary-color);
}

/* ===== Sections ===== */
.section {
    padding: 5rem 2rem;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
    color: var(--text-dark);
}

.section-title p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    font-weight: 400;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== Services Section ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    text-align: center;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--white);
}

.service-card h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-light);
}

/* ===== Portfolio Section ===== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.portfolio-item {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.portfolio-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.portfolio-content {
    padding: 1.5rem;
}

.portfolio-content h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.portfolio-content p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.portfolio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: var(--light-bg);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.875rem;
}

/* ===== Contact Form ===== */
.contact-section {
    background: var(--light-bg);
}

.contact-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 150px;
}

.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: none;
}

.alert.show {
    display: block;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ===== Footer ===== */
.footer {
    background: var(--dark-bg);
    color: var(--white);
    padding: 3rem 2rem 1rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-section p,
.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    display: block;
    margin-bottom: 0.5rem;
}

.footer-section a:hover {
    color: var(--white);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    /* Navigation */
    .nav-container {
        padding: 1rem;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--white);
        flex-direction: column;
        padding: 2rem;
        transition: var(--transition);
        box-shadow: var(--shadow-lg);
        overflow-y: auto;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    /* Logo */
    .logo {
        font-size: 1.25rem;
    }

    .logo img {
        width: 40px;
        height: 40px;
    }

    /* Hero Sections */
    .hero {
        padding-top: 80px;
        min-height: 100vh;
    }

    .portfolio-hero,
    .services-hero,
    .about-hero {
        padding: 100px 1rem 30px;
    }

    .hero-content {
        padding: 1rem;
    }

    .hero-title {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }

    /* Sections */
    .section {
        padding: 3rem 1rem;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .section-title p {
        font-size: 1rem;
    }

    /* Grids */
    .services-grid,
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Service Cards */
    .service-card {
        padding: 1.5rem;
    }

    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    /* Portfolio Items */
    .portfolio-image {
        height: 200px;
    }

    .portfolio-content {
        padding: 1rem;
    }

    /* Forms */
    .form-control {
        padding: 0.75rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    textarea.form-control {
        min-height: 120px;
    }

    /* Buttons */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
        min-height: 44px; /* Touch target size */
    }

    /* Footer */
    .footer {
        padding: 2rem 1rem 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .social-links {
        justify-content: center;
    }

    /* Project Details (Portfolio Page) */
    .project-detail {
        margin-bottom: 2rem;
    }

    .project-detail .row {
        flex-direction: column;
    }

    .project-detail img {
        height: 250px;
        width: 100%;
        object-fit: cover;
        border-radius: var(--border-radius) var(--border-radius) 0 0;
    }

    .project-info {
        padding: 1.5rem;
    }

    .project-meta {
        gap: 1rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .project-links {
        flex-direction: column;
        gap: 0.75rem;
    }

    .project-links .btn {
        width: 100%;
        text-align: center;
    }

    /* Profile image on About page */
    .profile-image {
        width: 150px;
        height: 150px;
        margin: 0 auto 1.5rem;
    }

    /* Stats section on About page */
    .stat-item {
        padding: 1.5rem 1rem;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .stat-label {
        font-size: 1rem;
    }

    /* Experience and certification cards */
    .experience-card,
    .certification-card {
        margin-bottom: 1.5rem;
    }

    /* Skill badges */
    .skill-badge {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
        margin: 0.2rem;
    }

    /* Service icons */
    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin: 0 auto 1rem;
    }

    /* Certification icons */
    .certification-icon {
        font-size: 2.5rem;
    }

    /* Ensure no horizontal scroll */
    body {
        overflow-x: hidden;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Feature list styling */
    .feature-list {
        padding-left: 1rem;
    }

    .feature-list li {
        font-size: 0.95rem;
        padding: 0.4rem 0;
        padding-left: 1.25rem;
    }
}

@media (max-width: 480px) {
    /* Extra small devices */
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-description {
        font-size: 0.95rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }

    .hero-buttons .btn,
    .about-hero .btn {
        margin: 0;
        margin-bottom: 0.75rem;
    }

    .hero-buttons .btn:last-child,
    .about-hero .btn:last-child {
        margin-bottom: 0;
    }

    .btn {
        width: 100%;
        padding: 0.875rem 1rem;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .section-title h2 {
        font-size: 1.75rem;
    }

    .nav-container {
        padding: 0.75rem 1rem;
    }

    .logo {
        font-size: 1.1rem;
    }

    .logo img {
        width: 35px;
        height: 35px;
    }

    .service-card,
    .portfolio-content,
    .project-info {
        padding: 1rem;
    }

    .portfolio-tags,
    .project-meta {
        gap: 0.5rem;
    }

    .tag {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }

    /* Ensure touch targets are large enough */
    .nav-link {
        padding: 0.75rem 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .social-link {
        width: 44px;
        height: 44px;
    }

    /* Form improvements */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-group label {
        font-size: 0.95rem;
    }

    /* Image responsiveness for small screens */
    .portfolio-image {
        height: 180px;
    }

    .project-detail img {
        height: 200px;
    }

    .profile-image {
        width: 120px;
        height: 120px;
    }

    .service-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .certification-icon {
        font-size: 2rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.9rem;
    }

    .stat-item {
        padding: 1rem;
    }

    /* Skill badges for small screens */
    .skill-badge {
        font-size: 0.8rem;
        padding: 0.35rem 0.7rem;
    }

    /* Feature list for small screens */
    .feature-list li {
        font-size: 0.9rem;
        padding: 0.35rem 0;
    }

    /* Experience and certification cards */
    .experience-card,
    .certification-card {
        margin-bottom: 1rem;
        padding: 1rem;
    }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 100px 1rem 50px;
    }

    .portfolio-hero,
    .services-hero,
    .about-hero {
        padding: 90px 1rem 30px;
    }
}

/* Tablet specific adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav-container {
        padding: 1rem 1.5rem;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 3rem;
    }

    .section {
        padding: 4rem 2rem;
    }
}

/* ===== Mobile-Specific Enhancements ===== */

/* Prevent text selection issues on mobile */
.btn, .nav-link, .social-link {
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
    user-select: none;
}

/* Smooth scrolling for mobile */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 80px; /* Account for fixed navbar */
    }
}

/* Improve readability on small screens */
@media (max-width: 480px) {
    body {
        font-size: 15px;
    }
    
    p {
        line-height: 1.7;
    }
}

/* Fix for iOS Safari bottom bar */
@supports (-webkit-touch-callout: none) {
    .hero {
        min-height: -webkit-fill-available;
    }
}

/* Prevent zoom on input focus (iOS) */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important; /* Prevents iOS zoom */
    }
}

/* ===== Utility Classes ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none; }
.visible { display: block; }

/* Mobile-friendly utility classes */
@media (max-width: 768px) {
    .mobile-hidden { display: none !important; }
    .mobile-visible { display: block !important; }
    .mobile-text-center { text-align: center !important; }
}
