/**
 * Responsive styles for CryptoExpert Portal
 * Version: 1.0
 * Date: 2025-07-30
 * Mobile and tablet responsive design
 */

/* Tablet Styles */
@media (max-width: 1024px) {
    .dashboard {
        padding: 1.5rem;
    }
    
    header {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.2rem;
    }
    
    .weather-forecast {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    
    .tab-button {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .dashboard {
        padding: 1rem;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .header-controls {
        justify-content: center;
    }
    
    .settings-button,
    .theme-toggle {
        width: 40px;
        height: 40px;
    }
    
    .weather {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .weather h2 {
        font-size: 1.2rem;
        text-align: center;
    }
    
    .weather-forecast {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .weather-item {
        padding: 0.8rem;
    }
    
    .department {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .department h2 {
        font-size: 1.3rem;
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .service-card {
        padding: 1.2rem;
    }
    
    .service-icon {
        font-size: 2rem;
    }
    
    .service-name {
        font-size: 1.1rem;
    }
    
    .service-description {
        font-size: 0.85rem;
    }
    
    /* Tab Navigation Mobile */
    .tab-navigation {
        flex-direction: column;
        border-radius: 8px;
    }
    
    .tab-button {
        padding: 0.8rem;
        border-bottom: 1px solid var(--border-color);
        border-radius: 0;
    }
    
    .tab-button:last-child {
        border-bottom: none;
        border-radius: 0 0 8px 8px;
    }
    
    .tab-button:first-child {
        border-radius: 8px 8px 0 0;
    }
    
    .tab-button.active::after {
        display: none;
    }
    
    /* Modal Mobile */
    .modal-content {
        width: 95%;
        margin: 1rem;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    #config-editor {
        height: 300px;
        font-size: 12px;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn {
        width: 100%;
        min-width: auto;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    .dashboard {
        padding: 0.5rem;
    }
    
    header {
        padding: 0.8rem;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    .weather {
        padding: 1rem;
    }
    
    .weather h2 {
        font-size: 1.1rem;
    }
    
    .department {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .department h2 {
        font-size: 1.2rem;
    }
    
    .service-card {
        padding: 1rem;
    }
    
    .service-icon {
        font-size: 1.8rem;
    }
    
    .service-name {
        font-size: 1rem;
    }
    
    .service-description {
        font-size: 0.8rem;
    }
    
    .service-status {
        font-size: 0.8rem;
    }
    
    /* Smaller buttons on very small screens */
    .settings-button,
    .theme-toggle {
        width: 35px;
        height: 35px;
    }
    
    .settings-button i,
    .theme-toggle i {
        font-size: 1.1rem;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    header {
        flex-direction: row;
        text-align: left;
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .weather-forecast {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .tab-navigation {
        flex-direction: row;
    }
    
    .tab-button {
        border-bottom: 3px solid transparent;
        border-right: 1px solid var(--border-color);
    }
    
    .tab-button:last-child {
        border-right: none;
    }
    
    .tab-button.active::after {
        display: block;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .service-icon {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    header h1 {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Print Styles */
@media print {
    .header-controls,
    .modal,
    .weather {
        display: none !important;
    }
    
    .dashboard {
        padding: 0;
    }
    
    .department {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .service-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .service-card:hover {
        transform: none;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .service-card:hover {
        transform: none;
    }
    
    .settings-button:hover i {
        transform: none;
    }
}

/* Dark Mode Specific Mobile Adjustments */
@media (max-width: 768px) {
    [data-theme="dark"] .service-card {
        border-color: #404040;
    }
    
    [data-theme="dark"] .tab-button {
        border-color: #404040;
    }
    
    [data-theme="dark"] .weather-item {
        border-color: #404040;
    }
}
