/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #f97316;
    --accent-color: #06b6d4;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-900: #111827;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-secondary: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Kanit', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

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

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

.nav-logo h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-logo span {
    color: var(--secondary-color);
}

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

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%236366f1' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 1;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-content {
    animation: slideInLeft 1s ease-out;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}

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

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

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

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.hero-image {
    position: relative;
    animation: slideInRight 1s ease-out;
}

.floating-card {
    position: absolute;
    background: var(--white);
    padding: 1rem;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    animation: float 6s ease-in-out infinite;
}

.floating-card i {
    font-size: 1.5rem;
}

.card-1 {
    top: 10%;
    left: 10%;
    color: #777bb4;
    animation-delay: 0s;
}

.card-2 {
    top: 20%;
    right: 10%;
    color: #ff2d20;
    animation-delay: 1s;
}

.card-3 {
    bottom: 30%;
    left: 5%;
    color: #fb70a9;
    animation-delay: 2s;
}

.card-4 {
    bottom: 10%;
    right: 15%;
    color: #00758f;
    animation-delay: 3s;
}

.hero-graphic {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 400px;
}

.code-window {
    background: var(--gray-900);
    border-radius: 10px;
    overflow: hidden;
    width: 300px;
    box-shadow: var(--shadow-xl);
}

.window-header {
    background: #2d3748;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
}

.window-controls {
    display: flex;
    gap: 0.5rem;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.control.red { background: #ff5f56; }
.control.yellow { background: #ffbd2e; }
.control.green { background: #27ca3f; }

.code-content {
    padding: 1.5rem;
    font-family: 'Courier New', monospace;
    color: var(--white);
    line-height: 1.8;
}

.keyword { color: #c792ea; }
.function { color: #82aaff; }
.string { color: #c3e88d; }

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    animation: bounce 2s infinite;
}

.scroll-indicator {
    color: var(--text-light);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Services Section */
.services {
    padding: 6rem 0;
    background: var(--white);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    justify-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-100);
    width: 100%;
    max-width: 350px;
    text-align: center;
}

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

.service-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
}

.service-icon i {
    font-size: 2rem;
    color: var(--white);
}

.service-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.service-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.service-features {
    list-style: none;
    text-align: left;
    max-width: 250px;
    margin: 0 auto;
}

.service-features li {
    padding: 0.5rem 0;
    color: var(--text-light);
    position: relative;
    padding-left: 1.5rem;
}

.service-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* Portfolio Section */
.portfolio {
    padding: 6rem 0;
    background: var(--gray-50);
}

.portfolio-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--gray-100);
    background: var(--white);
    color: var(--text-light);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.portfolio-item {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

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

.portfolio-image {
    height: 250px;
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-image::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 60px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.portfolio-image::after {
    content: '';
    position: absolute;
    top: 35px;
    left: 35px;
    width: 60%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    box-shadow: 
        0 8px 0 rgba(255, 255, 255, 0.2),
        0 16px 0 rgba(255, 255, 255, 0.2),
        0 24px 0 rgba(255, 255, 255, 0.15),
        0 32px 0 rgba(255, 255, 255, 0.15),
        0 40px 0 rgba(255, 255, 255, 0.1);
}

/* Portfolio Category Icons */
.portfolio-item[data-category="website"] .portfolio-image {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.portfolio-item[data-category="website"] .portfolio-image .floating-dots::before {
    content: '\f121';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.7);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    animation: none;
    background: rgba(255, 255, 255, 0.1);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-item[data-category="webapp"] .portfolio-image {
    background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
}

.portfolio-item[data-category="webapp"] .portfolio-image .floating-dots::before {
    content: '\f3cd';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.7);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    animation: none;
    background: rgba(255, 255, 255, 0.1);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-item[data-category="system"] .portfolio-image {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.portfolio-item[data-category="system"] .portfolio-image .floating-dots::before {
    content: '\f1c0';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.7);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    animation: none;
    background: rgba(255, 255, 255, 0.1);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Portfolio Animated Elements */
.portfolio-image .floating-dots {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.portfolio-image .floating-dots::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: floatDots 4s ease-in-out infinite;
    bottom: 20%;
    right: 25%;
    animation-delay: 1.5s;
}

/* Additional floating elements */
.portfolio-image::before {
    animation: slideInFromLeft 6s ease-in-out infinite;
}

@keyframes slideInFromLeft {
    0%, 100% {
        transform: translateX(0px);
        opacity: 0.05;
    }
    50% {
        transform: translateX(10px);
        opacity: 0.1;
    }
}

@keyframes floatDots {
    0%, 100% {
        transform: translateY(0px) scale(1);
        opacity: 0.4;
    }
    50% {
        transform: translateY(-15px) scale(1.5);
        opacity: 0.8;
    }
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
    padding: 2rem;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay h4 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.portfolio-overlay p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.portfolio-links {
    display: flex;
    gap: 1rem;
}

.portfolio-link {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.3s ease;
}

.portfolio-link:hover {
    background: var(--secondary-color);
}

/* About Section */
.about {
    padding: 6rem 0;
    background: var(--white);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-description {
    margin-bottom: 2rem;
}

.about-description p {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-light);
    font-weight: 500;
}

.about-graphic {
    display: flex;
    justify-content: center;
    align-items: center;
}

.tech-stack {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 400px;
}

.tech-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all 0.3s ease;
}

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

.tech-item i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.tech-item:nth-child(1) i { color: #777bb4; }
.tech-item:nth-child(2) i { color: #ff2d20; }
.tech-item:nth-child(3) i { color: #fb70a9; }
.tech-item:nth-child(4) i { color: #00758f; }
.tech-item:nth-child(5) i { color: #e34c26; }
.tech-item:nth-child(6) i { color: #1572b6; }

.tech-item span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Contact Section */
.contact {
    padding: 6rem 0;
    background: var(--gray-50);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
}

.contact-details h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

.contact-details p {
    color: var(--text-light);
}

.contact-form {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--gray-100);
    border-radius: 10px;
    font-family: 'Kanit', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Footer */
.footer {
    background: var(--gray-900);
    color: var(--white);
    padding: 3rem 0 1rem;
}

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

.footer-logo h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.footer-logo span {
    color: var(--secondary-color);
}

.footer-logo p {
    color: var(--text-light);
}

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

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

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

.social-links a {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.3s ease;
}

.social-links a:hover {
    background: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    color: var(--text-light);
}

/* Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero {
        padding-top: 5rem;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .hero {
        padding-top: 6rem;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .hero-title {
        font-size: 2.5rem;
        margin-top: 2rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tech-stack {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .floating-card {
        font-size: 0.8rem;
        padding: 0.75rem;
    }
    
    .floating-card i {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding-top: 7rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .service-card {
        padding: 2rem;
    }
    
    .contact-form {
        padding: 2rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

/* iOS Safari and PWA Install Banner Optimization */
/* Install Banner - iOS Safari specific improvements */
.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* iOS Safari specific fixes */
    -webkit-transform: translateY(100%);
    -webkit-transition: -webkit-transform 0.3s ease-out;
    /* Ensure proper rendering on iOS */
    will-change: transform;
    contain: layout style paint;
    /* Add safe area support for iPhone notch */
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}

.install-banner.show {
    transform: translateY(0);
    -webkit-transform: translateY(0);
}

/* Improve button styling for iOS */
.install-banner button {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-clip: padding-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent iOS zoom on double tap */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    /* Prevent text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    /* Improve rendering */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

/* iOS specific media query for better compatibility */
@supports (-webkit-overflow-scrolling: touch) {
    .install-banner {
        /* Improve backdrop filter for iOS */
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        /* Fix potential rendering issues */
        transform: translate3d(0, 100%, 0);
        -webkit-transform: translate3d(0, 100%, 0);
    }
    
    .install-banner.show {
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
    }
    
    .install-banner button {
        /* Additional iOS Safari button fixes */
        -webkit-border-radius: 8px;
        border-radius: 8px;
        min-height: 44px; /* iOS minimum touch target */
        font-family: inherit;
        font-size: inherit;
    }
}

/* Dark mode support for iOS */
@media (prefers-color-scheme: dark) {
    .install-banner .install-btn {
        background: #f8f9fa !important;
        color: var(--primary-color) !important;
    }
    
    .install-banner .dismiss-btn {
        background: rgba(255, 255, 255, 0.15) !important;
        border-color: rgba(255, 255, 255, 0.25) !important;
    }
}

/* Additional iOS Safari fixes for overall site */
@supports (-webkit-overflow-scrolling: touch) {
    /* Fix iOS Safari viewport issues */
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Improve button rendering across the site */
    .btn, button, input[type="submit"], input[type="button"] {
        -webkit-appearance: none;
        appearance: none;
        -webkit-border-radius: 0;
        border-radius: 8px;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Fix potential z-index issues with iOS keyboard */
    .navbar {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}