/* Admin Panel Responsive Styles */

/* Tablets and Small Laptops */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 250px;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .properties-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .quick-actions {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Users Page */
    .data-table {
        font-size: 0.9rem;
    }
    
    .user-info-cell {
        gap: 0.5rem;
    }
    
    /* Settings Page */
    .settings-nav {
        flex-wrap: wrap;
    }
    
    .settings-tab {
        flex: 1;
        min-width: 120px;
        text-align: center;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .admin-sidebar {
        position: fixed;
        left: -280px;
        height: 100vh;
        z-index: 1000;
    }
    
    .admin-sidebar.active {
        left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .admin-header {
        padding: 1rem;
    }
    
    .admin-content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content-toolbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .toolbar-left {
        flex-direction: column;
        width: 100%;
    }
    
    .search-box {
        max-width: none;
    }
    
    .property-form .form-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    /* Users Page */
    .data-table {
        display: block;
        overflow-x: auto;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.8rem 0.5rem;
        white-space: nowrap;
    }
    
    .user-info-cell {
        min-width: 150px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .action-btn {
        width: 30px;
        height: 30px;
    }
    
    /* Settings Page */
    .settings-nav {
        gap: 0.3rem;
    }
    
    .settings-tab {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .settings-tab-content {
        margin-top: 1rem;
    }
}

/* Mobile Phones */
@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .properties-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .toolbar-right {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
    }
    
    .modal {
        padding: 1rem;
    }
    
    /* Users Page */
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.6rem 0.3rem;
    }
    
    .user-avatar-sm {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .user-details .user-name {
        font-size: 0.9rem;
    }
    
    .user-details .user-email {
        font-size: 0.7rem;
    }
    
    .role-badge,
    .status-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    /* Settings Page */
    .settings-nav {
        flex-direction: column;
    }
    
    .settings-tab {
        text-align: left;
        border-radius: 0;
        border-bottom: 1px solid var(--gray-dark);
    }
    
    .settings-tab:last-child {
        border-bottom: none;
    }
    
    .content-card {
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-content {
        padding: 1rem;
    }
}

/* Small Mobile Phones */
@media (max-width: 480px) {
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .breadcrumb {
        font-size: 0.8rem;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .stat-trend {
        margin-left: 0;
    }
    
    .recent-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .item-actions {
        margin-left: 0;
    }
    
    /* Users Page */
    .data-table {
        font-size: 0.75rem;
    }
    
    .data-table th:nth-child(4),
    .data-table td:nth-child(4),
    .data-table th:nth-child(5),
    .data-table td:nth-child(5) {
        display: none;
    }
    
    .user-info-cell {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .toolbar-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .toolbar-btn i {
        margin-right: 0.3rem;
    }
    
    /* Settings Page */
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 0.9rem;
        padding: 0.6rem;
    }
    
    .checkbox-label {
        font-size: 0.9rem;
    }
}

/* Extra Small Mobile Phones */
@media (max-width: 360px) {
    .admin-header h1 {
        font-size: 1.5rem;
    }
    
    .stat-info h3 {
        font-size: 1.5rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    /* Users Page */
    .data-table th:nth-child(3),
    .data-table td:nth-child(3) {
        display: none;
    }
    
    .toolbar-right {
        flex-direction: column;
        width: 100%;
    }
    
    .toolbar-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Settings Page */
    .settings-tab {
        padding: 0.8rem;
        font-size: 0.8rem;
    }
    
    .card-header h2 {
        font-size: 1.2rem;
    }
}

/* High-resolution displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .property-image img,
    .file-preview-item img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    .user-avatar-sm,
    .user-avatar {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Print styles */
@media print {
    .admin-sidebar,
    .admin-header,
    .content-toolbar,
    .property-actions,
    .btn,
    .action-buttons,
    .settings-nav,
    .form-actions {
        display: none !important;
    }
    
    .admin-main {
        margin: 0;
    }
    
    .admin-content {
        padding: 0;
    }
    
    .property-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 1rem;
    }
    
    .data-table {
        width: 100%;
        border-collapse: collapse;
    }
    
    .data-table th,
    .data-table td {
        border: 1px solid #ccc;
        padding: 0.5rem;
    }
    
    .content-card {
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 1rem;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .modal-content {
        animation: none;
    }
    
    .property-card:hover,
    .stat-card:hover,
    .quick-action:hover,
    .recent-item:hover,
    .settings-tab:hover {
        transform: none;
    }
    
    .admin-sidebar {
        transition: none;
    }
}

/* Dark mode support 
@media (prefers-color-scheme: dark) {
    .admin-dashboard {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .admin-sidebar,
    .admin-header,
    .content-card,
    .property-card,
    .content-toolbar,
    .modal-content {
        background: #2d2d2d;
        border-color: #404040;
        color: #ffffff;
    }
    
    .stat-card,
    .quick-action {
        background: #2d2d2d;
        border-color: #404040;
    }
    
    .search-box input,
    .filter-select,
    .form-group input,
    .form-group select,
    .form-group textarea {
        background: #2d2d2d;
        border-color: #404040;
        color: #ffffff;
    }
    
    .file-upload-area {
        border-color: #404040;
        background: #2d2d2d;
    }
*/
    
    /* Users Page Dark Mode */
    .data-table th {
        background: #363636;
        color: #ffffff;
    }
    
    .data-table tr:hover {
        background: #363636;
    }
    
    .user-avatar-sm,
    .user-avatar {
        background: #404040;
        color: #cccccc;
    }
    
    /* Settings Page Dark Mode */
    .settings-tab {
        background: #363636;
        color: #cccccc;
        border-color: #404040;
    }
    
    .settings-tab.active {
        background: var(--primary);
        color: white;
    }
    
    .settings-tab:hover {
        background: #404040;
        color: #ffffff;
    }
    
    .checkbox-label {
        color: #ffffff;
    }
    
    .checkmark {
        border-color: #666666;
    }
    
    .table-info {
        color: #cccccc;
    }
}

/* Landscape orientation for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .admin-sidebar {
        overflow-y: auto;
    }
    
    .sidebar-menu {
        padding: 1rem 0;
    }
    
    .menu-section {
        margin-bottom: 1rem;
    }
    
    .admin-content {
        padding: 1rem;
    }
    
    .content-toolbar {
        padding: 1rem;
    }
    
    .modal-content {
        max-height: 80vh;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .property-actions {
        opacity: 1;
        position: relative;
        top: auto;
        right: auto;
        justify-content: center;
        margin-top: 1rem;
    }
    
    .action-btn {
        width: 44px;
        height: 44px;
    }
    
    .header-btn,
    .toolbar-btn,
    .pagination-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .settings-tab {
        padding: 1rem 1.5rem;
    }
    
    /* Improve touch targets for mobile */
    .menu-section li a {
        padding: 1rem 1.5rem;
    }
    
    .recent-item {
        padding: 1.2rem;
    }
    
    .quick-action {
        padding: 2rem 1rem;
    }
}