/**
 * MyDubai Custom Styles
 * Enhanced responsive styles and component-specific CSS
 *
 * @package MyDubai
 */

/* Property Cards Enhanced */
.property-card {
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.property-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.property-card-image {
    position: relative;
    overflow: hidden;
}

.property-card-image img {
    transition: transform 0.3s ease;
}

.property-card:hover .property-card-image img {
    transform: scale(1.05);
}

.property-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--secondary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 10;
}

.property-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.property-card-title {
    font-size: 1.15rem;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.property-card-location {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.property-card-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 12px;
    flex: 1;
}

.property-card-types {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.property-card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: auto;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    transition: all 0.3s ease;
}

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

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

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

/* Filter Sidebar */
.filters-sidebar .form-group {
    margin-bottom: 20px;
}

.filters-sidebar label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

.filter-select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 10px;
}

.breadcrumbs a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: white;
    text-decoration: underline;
}

/* Sticky Header on Scroll */
.site-header.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Search Form on Homepage */
.search-form select,
.search-form input {
    font-size: 16px; /* Prevents zoom on iOS */
}

/* Job Cards */
.job-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.job-meta .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
    vertical-align: middle;
}

/* Form Errors */
input.error,
textarea.error,
select.error {
    border-color: var(--danger);
}

/* Notice Messages */
.notice {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.notice-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notice-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.notice-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.notice-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Loading Spinner */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-dark);
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Mobile Menu */
    .mobile-menu-toggle {
        display: flex;
    }

    .main-nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 70px);
        background: white;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        transition: left 0.3s ease;
        z-index: 999;
        overflow-y: auto;
    }

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

    .main-nav ul {
        flex-direction: column;
        padding: 20px;
        gap: 0;
    }

    .main-nav li {
        border-bottom: 1px solid #e0e0e0;
    }

    .main-nav a {
        display: block;
        padding: 15px 0;
    }

    /* Grid Adjustments */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Header */
    .header-inner {
        padding: 15px 0;
    }

    .site-logo {
        font-size: 20px;
    }

    /* Hero Section */
    .hero-section h1 {
        font-size: 2rem !important;
    }

    .hero-section p {
        font-size: 1rem !important;
    }

    /* Property Archive - Stack Sidebar */
    .container section > div[style*="grid-template-columns: 300px 1fr"],
    .container section > div[style*="grid-template-columns: 2fr 1fr"] {
        display: block !important;
    }

    .filters-sidebar {
        margin-bottom: 30px;
    }

    .filters-sidebar .card {
        position: static !important;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Cards */
    .card-content {
        padding: 15px;
    }

    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

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

@media (max-width: 480px) {
    /* Search Form Grid */
    .search-form > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Market Snapshot */
    .market-snapshot .grid-4 > div {
        padding: 20px 15px !important;
    }

    /* Hero */
    .hero-section {
        padding: 40px 0 !important;
    }

    .hero-section h1 {
        font-size: 1.75rem !important;
    }

    /* Container */
    .container {
        padding: 0 15px;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    .filters-sidebar,
    .btn,
    #property-inquiry-form,
    #job-application-form,
    .mobile-menu-toggle {
        display: none !important;
    }

    .container {
        max-width: 100%;
    }

    a {
        text-decoration: underline;
    }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    /* You can add dark mode styles here if needed */
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

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

/* 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-width: 0;
}

/* Focus Styles for Accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to Content Link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}
