/**
 * ATLAS Mobile Modals CSS - Phase 3 Day 2
 * Styles for mobile-specific modals and overlays
 * 
 * @author Tunahan Bağcacıer
 * @version 1.0.0
 */

/* Mobile Filter Modal */
.mobile-filter-toggle {
    position: fixed;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-floating);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    padding: var(--space-sm) var(--space-md);
    font-weight: 600;
    font-size: var(--text-sm);
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    gap: var(--space-xs);
    min-height: var(--touch-target);
    transition: all 0.3s ease;
}

@media (max-width: 767px) {
    .mobile-filter-toggle {
        display: flex;
    }
    
    .property-filters {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 85vh;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        z-index: var(--z-modal);
        overflow-y: auto;
        padding: var(--space-lg);
    }
    
    .property-filters.atlas-active {
        transform: translateY(0);
    }
}

.mobile-filter-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--z-modal) - 1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-filter-backdrop.atlas-active {
    opacity: 1;
    visibility: visible;
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.filter-header h3 {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.filter-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: var(--text-lg);
    cursor: pointer;
    padding: var(--space-sm);
}

.mobile-filter-actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-md);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
    margin-top: var(--space-lg);
}

.filter-count {
    background: white;
    color: var(--primary-color);
    font-size: var(--text-xs);
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: var(--space-xs);
}

/* Mobile Search Modal */
.mobile-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: white;
    z-index: var(--z-modal);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-search-modal.atlas-active {
    transform: translateY(0);
}

.search-modal-header {
    display: flex;
    align-items: center;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
    background: white;
    position: sticky;
    top: 0;
    z-index: 1;
}

.search-modal-back {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: var(--text-lg);
    margin-right: var(--space-md);
    min-width: var(--touch-target);
    height: var(--touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-modal-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-modal-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: var(--text-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--background-secondary);
    border-radius: var(--radius-md);
}

.search-clear {
    position: absolute;
    right: var(--space-xs);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    min-width: var(--touch-target);
    height: var(--touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-modal-actions {
    display: flex;
    gap: var(--space-xs);
    margin-left: var(--space-md);
}

.search-voice,
.search-location {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    min-width: var(--touch-target);
    height: var(--touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.search-voice.listening {
    color: var(--primary-color);
    background: var(--primary-color-light);
}

.search-location.loading {
    animation: pulse 1s infinite;
}

.search-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
}

.search-section-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-clear-recent {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: var(--text-xs);
    padding: var(--space-xs);
}

.search-suggestion-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: transparent;
    border: none;
    text-align: left;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xs);
    min-height: var(--touch-target);
    transition: background 0.2s ease;
}

.search-suggestion-item:hover,
.search-suggestion-item:focus {
    background: var(--background-secondary);
}

.search-suggestion-item i {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    width: 20px;
    text-align: center;
}

.search-popular-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-xs);
}

.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-xl);
    color: var(--text-secondary);
}

.search-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Mobile Gallery Modal */
.mobile-gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: black;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-gallery-modal.atlas-active {
    opacity: 1;
    visibility: visible;
}

.gallery-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    padding: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1;
    color: white;
}

.gallery-close,
.gallery-share,
.gallery-download {
    background: transparent;
    border: none;
    color: white;
    font-size: var(--text-lg);
    min-width: var(--touch-target);
    height: var(--touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-counter {
    font-size: var(--text-sm);
    font-weight: 600;
}

.gallery-actions {
    display: flex;
    gap: var(--space-xs);
}

.gallery-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-viewport {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.gallery-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.gallery-main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
    transform-origin: center center;
}

.gallery-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.gallery-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 var(--space-md);
    pointer-events: none;
}

.gallery-prev,
.gallery-next {
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    font-size: var(--text-lg);
    min-width: var(--touch-target);
    height: var(--touch-target);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    transition: background 0.2s ease;
}

.gallery-prev:hover,
.gallery-next:hover {
    background: rgba(0,0,0,0.8);
}

.gallery-zoom-controls {
    position: absolute;
    bottom: 100px;
    right: var(--space-md);
    background: rgba(0,0,0,0.5);
    border-radius: var(--radius-full);
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.gallery-zoom-in,
.gallery-zoom-out,
.gallery-zoom-reset {
    background: transparent;
    border: none;
    color: white;
    font-size: var(--text-sm);
    min-width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-zoom-level {
    color: white;
    font-size: var(--text-xs);
    font-weight: 600;
    padding: var(--space-xs) 0;
}

.gallery-thumbnails {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: var(--space-md);
}

.thumbnails-container {
    background: rgba(0,0,0,0.5);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    margin-bottom: var(--space-sm);
    max-height: 60px;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.thumbnails-container.visible {
    transform: translateY(0);
}

.thumbnails-list {
    display: flex;
    gap: var(--space-xs);
    overflow-x: auto;
    padding: var(--space-xs) 0;
}

.thumbnail-item {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid transparent;
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.thumbnail-item.active {
    border-color: white;
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnails-toggle {
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    border-radius: 50%;
    min-width: var(--touch-target);
    height: var(--touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Mobile Contact Modal */
.mobile-contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: var(--z-modal);
    display: flex;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-contact-modal.atlas-active {
    opacity: 1;
    visibility: visible;
}

.contact-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.contact-modal-content {
    background: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    padding: var(--space-lg);
}

.mobile-contact-modal.atlas-active .contact-modal-content {
    transform: translateY(0);
}

.contact-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.contact-property-info .property-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.contact-property-info .property-price {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--primary-color);
}

.contact-modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: var(--text-lg);
    min-width: var(--touch-target);
    height: var(--touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.contact-action {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--background-secondary);
    border: none;
    border-radius: var(--radius-md);
    text-align: left;
    min-height: 60px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.contact-action:hover {
    background: var(--primary-color-light);
    transform: translateY(-2px);
}

.contact-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    color: white;
}

.contact-call .contact-action-icon {
    background: #10b981;
}

.contact-whatsapp .contact-action-icon {
    background: #25d366;
}

.contact-sms .contact-action-icon {
    background: #3b82f6;
}

.contact-email .contact-action-icon {
    background: #f59e0b;
}

.contact-action-text {
    flex: 1;
}

.action-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.action-subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    display: block;
}

.contact-quick-message {
    margin-bottom: var(--space-lg);
}

.quick-message-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.quick-message-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.quick-message-btn {
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-message-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.contact-form {
    margin-bottom: var(--space-lg);
}

.contact-form-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.contact-success-message {
    text-align: center;
    padding: var(--space-xl);
}

.success-icon {
    font-size: 3rem;
    color: var(--success-color);
    margin-bottom: var(--space-md);
}

.success-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.success-subtitle {
    font-size: var(--text-md);
    color: var(--text-secondary);
}

.company-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--background-secondary);
    border-radius: var(--radius-md);
    margin-top: var(--space-md);
}

.company-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.company-name {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
}

.company-subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Toast notifications */
.atlas-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    z-index: var(--z-tooltip);
    opacity: 0;
    transition: all 0.3s ease;
}

.atlas-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Mobile-only styles */
@media (min-width: 768px) {
    .mobile-filter-toggle,
    .mobile-search-modal,
    .mobile-gallery-modal,
    .mobile-contact-modal {
        display: none !important;
    }
}
