/**
 * Mobile-Optimized Components
 * Reusable UI components optimized for mobile touch interactions
 * Part of: İzmir Tenteci Mobile Optimization Project
 */

/* ========================================
   TOUCH-OPTIMIZED BUTTONS
   ======================================== */
.btn-hero-primary,
.btn-hero-outline {
    min-height: 48px;
    min-width: 48px;
    padding: 14px 24px;
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
}

/* Ripple effect container */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* ========================================
   FORM INPUTS (TOUCH OPTIMIZED)
   ======================================== */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    color: var(--text-light);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    font-size: 16px; /* Prevents iOS zoom on focus */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(245, 245, 245, 0.5);
}

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

/* ========================================
   SERVICE CARDS (BENTO GRID)
   ======================================== */
.service-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.15);
}

.service-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.service-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.service-card:hover .service-card-image img {
    transform: scale(1.03);
}

.service-card-content {
    padding: var(--space-lg);
}

.service-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: var(--space-sm);
}

.service-card-description {
    color: var(--text-gray);
    line-height: 1.6;
}

/* ========================================
   STATS COUNTER (MOBILE)
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.stats-item {
    text-align: center;
    padding: var(--space-lg);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

.stats-number {
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: 700;
    color: var(--primary);
    display: block;
    margin-bottom: var(--space-xs);
}

.stats-label {
    font-size: 0.875rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================
   TESTIMONIALS (MOBILE CARDS)
   ======================================== */
.testimonials-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.testimonial-card {
    background: var(--bg-card);
    padding: var(--space-lg);
    border-radius: var(--radius-xl);
    position: relative;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    font-size: 4rem;
    color: var(--primary);
    opacity: 0.3;
    font-family: Georgia, serif;
}

.testimonial-text {
    color: var(--text-gray);
    line-height: 1.7;
    margin-bottom: var(--space-md);
    position: relative;
    z-index: 1;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.testimonial-name {
    font-weight: 600;
    color: var(--white);
}

.testimonial-title {
    font-size: 0.875rem;
    color: var(--text-gray);
}

/* ========================================
   ACCORDION (MOBILE)
   ======================================== */
.accordion {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.accordion-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
}

.accordion-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-item.active .accordion-content {
    max-height: 500px;
}

.accordion-body {
    padding-bottom: var(--space-md);
    color: var(--text-gray);
    line-height: 1.6;
}

/* ========================================
   PROCESS STEPS (MOBILE)
   ======================================== */
.process-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.process-step {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
}

.process-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--black);
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: 50%;
}

.process-content {
    flex: 1;
}

.process-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: var(--space-xs);
}

.process-description {
    color: var(--text-gray);
    line-height: 1.6;
}

/* ========================================
   GALLERY/IMAGE GRID (MOBILE)
   ======================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: var(--space-md);
}

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

.gallery-title {
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ========================================
   NOTIFICATION/TOAST (MOBILE)
   ======================================== */
.toast {
    position: fixed;
    bottom: var(--space-md);
    left: var(--space-md);
    right: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-tooltip);
    transform: translateY(150%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateY(0);
}

.toast-success {
    border-left: 4px solid #10B981;
}

.toast-error {
    border-left: 4px solid #EF4444;
}

.toast-warning {
    border-left: 4px solid #F59E0B;
}

.toast-message {
    color: var(--white);
    font-size: 0.875rem;
}

/* ========================================
   SEARCH BAR (MOBILE)
   ======================================== */
.search-bar {
    position: relative;
    margin-bottom: var(--space-md);
}

.search-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 48px 12px 16px;
    font-size: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.search-input::placeholder {
    color: rgba(245, 245, 245, 0.5);
}

.search-button {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

/* ========================================
   LOADING/SPINNER (MOBILE)
   ======================================== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(212, 175, 55, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========================================
   SOCIAL SHARE (MOBILE)
   ======================================== */
.social-share {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.social-share-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 50%;
    color: var(--white);
    transition: all 0.3s ease;
}

.social-share-btn:hover {
    background: var(--primary);
    color: var(--black);
    transform: translateY(-2px);
}

/* ========================================
   SKIP LINK (ACCESSIBILITY)
   ======================================== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: var(--black);
    padding: 8px 16px;
    text-decoration: none;
    z-index: var(--z-tooltip);
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
}

/* ========================================
   PULL TO REFRESH INDICATOR
   ======================================== */
.pull-refresh {
    position: fixed;
    top: -60px;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    z-index: var(--z-fixed);
    transition: top 0.3s ease;
}

.pull-refresh.active {
    top: 0;
}

.pull-refresh-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
    animation: spin 1s linear infinite;
}

/* ========================================
   SWIPE INDICATORS (CAROUSEL)
   ======================================== */
.swipe-indicators {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.swipe-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.swipe-indicator.active {
    width: 24px;
    border-radius: 4px;
    background: var(--primary);
}

/* ========================================
   MOBILE-SPECIFIC HELPERS
   ======================================== */
/* Increase touch target size for small screens */
@media (max-width: 480px) {
    .btn,
    button,
    .accordion-header,
    .social-share-btn {
        min-height: 48px;
        min-width: 48px;
    }
}

/* Safe area for notched devices */
@supports (padding: env(safe-area-inset-bottom)) {
    .site-footer {
        padding-bottom: calc(env(safe-area-inset-bottom) + var(--space-md));
    }

    .toast {
        bottom: calc(env(safe-area-inset-bottom) + var(--space-md));
    }
}
