/* Riyalix Website - Additional Fixes and Improvements */

/* Performance optimizations */
img, picture, video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Better font rendering */
body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Improved accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-green);
    color: white;
    padding: 8px;
    z-index: 10000;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}

/* Prevent layout shift */
.hero-phone .phone-mockup {
    aspect-ratio: 9/19;
    width: 100%;
    max-width: 300px;
}

/* Better contrast for better readability */
.nav-link:hover {
    color: var(--royal-gold-light);
}

/* Smooth animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Better button states */
.btn-download:active,
.btn-company:active {
    transform: translateY(0);
}

.btn-download:disabled,
.btn-company:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Fix z-index issues */
.navbar {
    z-index: 1000;
    position: relative;
}

.hero {
    z-index: 1;
    position: relative;
}

/* Better mobile typography */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.5rem;
        line-height: 1.4;
    }
    
    p {
        font-size: 1rem;
        line-height: 1.6;
    }
}

/* Fix timeline overlapping */
.development-timeline::before {
    z-index: 1;
}

.timeline-content {
    z-index: 2;
    position: relative;
}

/* Better form styling */
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--royal-gold);
    outline-offset: 2px;
    border-color: var(--royal-gold);
}

/* Fix phone mockup scrolling */
.phone-screen {
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.phone-screen::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Better mobile navigation */
@media (max-width: 768px) {
    .nav-menu .nav-link {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 1.2rem 1rem;
        display: block;
        width: 100%;
        text-align: center;
        margin: 0.2rem 0;
        border-radius: var(--radius-md);
    }
    
    .nav-menu .nav-link:last-of-type {
        border-bottom: none;
    }
    
    .nav-menu .nav-link:hover,
    .nav-menu .nav-link.active {
        background: rgba(212, 175, 55, 0.2);
        color: var(--royal-gold);
        transform: scale(1.02);
    }
    
    .mobile-actions {
        border-top: 2px solid var(--royal-gold);
        padding-top: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .mobile-actions .btn-download,
    .mobile-actions .btn-company {
        width: 80%;
        max-width: 250px;
        margin: 0.5rem auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    /* Fix navbar z-index on mobile */
    .navbar {
        z-index: 9999;
    }
    
    .nav-menu {
        z-index: 9998;
    }
}

/* Loading animation for better UX */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Fix hero content spacing */
@media (max-width: 768px) {
    .hero-content {
        gap: 3rem;
        padding: 2rem 0;
    }
    
    .hero-text {
        text-align: center;
    }
    
    .hero-buttons {
        justify-content: center;
    }
}

/* Better glass effect */
.glass-card {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Fix section spacing */
section {
    position: relative;
    z-index: 1;
}

/* Better button interactions */
.btn-store,
.btn-download,
.btn-company {
    will-change: transform;
    backface-visibility: hidden;
}

.btn-store:hover,
.btn-download:hover,
.btn-company:hover {
    transform: translateY(-2px) scale(1.02);
}

/* Footer Improvements */
.footer {
    background: linear-gradient(135deg, var(--primary-green-dark), var(--primary-green));
    padding: 3rem 0 1rem;
    margin-top: 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--royal-gold);
    margin-bottom: 1rem;
}

.footer-logo i {
    color: var(--royal-gold);
    font-size: 1.8rem;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.footer-section h4 {
    color: var(--royal-gold);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--royal-gold-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    font-size: 0.9rem;
}

.footer-bottom a {
    color: var(--royal-gold);
    text-decoration: none;
}

.footer-bottom a:hover {
    color: var(--royal-gold-light);
}

/* Contact Form Improvements */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--glass-shadow);
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: var(--royal-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.contact-icon i {
    font-size: 1.5rem;
    color: var(--primary-green-dark);
}

.contact-card h3 {
    color: var(--royal-gold);
    margin-bottom: 0.5rem;
}

.contact-card p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.contact-form {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: var(--royal-gold);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: white;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--royal-gold);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.btn-submit {
    background: linear-gradient(45deg, var(--royal-gold), var(--royal-gold-light));
    color: var(--primary-green-dark);
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Mobile Footer */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-brand {
        max-width: none;
        margin-bottom: 2rem;
    }
    
    .footer-logo {
        justify-content: center;
        font-size: 2rem;
    }
    
    .footer-section {
        margin-bottom: 1.5rem;
    }
    
    .footer-section h4 {
        border-bottom: 1px solid rgba(212, 175, 55, 0.3);
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .footer-bottom {
        padding-top: 1.5rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .footer-bottom p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-info {
        order: 2;
    }
    
    .contact-form {
        order: 1;
    }
}

/* Fix for disabled store buttons */
.btn-store.disabled {
    opacity: 0.8;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 2px dashed rgba(212, 175, 55, 0.5);
}

.btn-store.disabled::after {
    content: 'قيد التطوير';
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--royal-gold);
    color: var(--primary-green-dark);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Smooth transitions */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

/* Loading states */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Error states */
.error {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

/* Success states */
.success {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

/* Additional hamburger menu fixes */
@media (max-width: 768px) {
    .nav-menu {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out, left 0.3s ease-in-out;
    }
    
    .nav-menu.active {
        transform: translateX(0);
        left: 0 !important;
    }
    
    .hamburger {
        cursor: pointer;
        z-index: 1001;
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active .bar:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
}