/**
 * =============================================================================
 * SILBERRADAR.EU - RESPONSIVE STYLES
 * =============================================================================
 * Optimiertes Layout für Mobile, Tablet und Desktop
 * Sprint: 8 (FINAL)
 * =============================================================================
 */

/* =============================================================================
   MOBILE FIRST - Base Styles (320px+)
   ============================================================================= */

/* Container */
.container {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
    margin: 0 auto;
}

/* Navigation Mobile */
@media (max-width: 767px) {
    .header-inner {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .nav {
        order: 3;
        width: 100%;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--silver-200);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .nav::-webkit-scrollbar {
        display: none;
    }
    
    .nav-link {
        flex-shrink: 0;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .nav-link svg {
        width: 16px;
        height: 16px;
    }
    
    .nav-link span {
        display: inline;
    }
    
    /* Page Headers */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    /* KPI Grid */
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .kpi-card {
        padding: 1rem;
    }
    
    .kpi-value {
        font-size: 1.25rem;
    }
    
    .kpi-icon {
        width: 40px;
        height: 40px;
    }
    
    /* Charts */
    .charts-row,
    .charts-row.two-cols {
        grid-template-columns: 1fr;
    }
    
    .chart-body {
        height: 220px;
    }
    
    /* Tables */
    .table-responsive {
        margin: 0 -1rem;
        padding: 0 1rem;
        overflow-x: auto;
    }
    
    .profit-table th,
    .profit-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    /* Hide less important columns on mobile */
    .profit-table th:nth-child(3),
    .profit-table td:nth-child(3),
    .profit-table th:nth-child(6),
    .profit-table td:nth-child(6) {
        display: none;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    /* Quick Actions */
    .quick-actions {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .action-card {
        padding: 1rem;
    }
    
    .action-icon {
        width: 40px;
        height: 40px;
    }
    
    .action-card span {
        font-size: 0.85rem;
    }
    
    /* Forms */
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-group {
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Two Column Layout */
    .two-column-layout {
        grid-template-columns: 1fr;
    }
    
    .calculator-sidebar {
        position: static;
        order: -1;
        margin-bottom: 1.5rem;
    }
    
    /* Profit Hero */
    .profit-hero {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
    
    .profit-hero-value {
        font-size: 2rem;
    }
    
    .profit-hero-percent {
        font-size: 1.125rem;
    }
    
    .profit-hero-details {
        grid-template-columns: 1fr;
    }
    
    /* Detail Pages */
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-actions {
        flex-direction: column;
    }
    
    .detail-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Value Comparison */
    .value-comparison {
        flex-direction: column;
    }
    
    .value-box {
        max-width: none;
        width: 100%;
    }
    
    .value-arrow {
        transform: rotate(90deg);
    }
    
    /* Settings */
    .settings-layout {
        grid-template-columns: 1fr;
    }
    
    .settings-sidebar {
        order: -1;
    }
    
    .settings-row {
        grid-template-columns: 1fr;
    }
    
    /* Buttons */
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn svg {
        width: 16px;
        height: 16px;
    }
}

/* =============================================================================
   TABLET (768px - 1023px)
   ============================================================================= */

@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    /* Navigation */
    .nav-link span {
        display: inline;
    }
    
    /* KPI Grid */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Charts */
    .charts-row.two-cols {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Quick Actions */
    .quick-actions {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Forms */
    .two-column-layout {
        grid-template-columns: 1fr;
    }
    
    .calculator-sidebar {
        position: static;
    }
    
    /* Profit Hero */
    .profit-hero {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Settings */
    .settings-layout {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   DESKTOP (1024px+)
   ============================================================================= */

@media (min-width: 1024px) {
    .container {
        max-width: 1400px;
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    /* KPI Grid */
    .kpi-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Charts */
    .charts-row.two-cols {
        grid-template-columns: 1fr 1fr;
    }
    
    .chart-body {
        height: 300px;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Forms */
    .two-column-layout {
        grid-template-columns: 1fr 360px;
    }
    
    .calculator-sidebar {
        position: sticky;
        top: 100px;
    }
    
    /* Settings */
    .settings-layout {
        grid-template-columns: 1fr 300px;
    }
}

/* =============================================================================
   LARGE DESKTOP (1400px+)
   ============================================================================= */

@media (min-width: 1400px) {
    .container {
        max-width: 1600px;
    }
    
    .dashboard {
        max-width: 1400px;
    }
}

/* =============================================================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================================================= */

@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 44px;
    }
    
    .nav-link {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
    
    .form-input,
    .form-select {
        min-height: 44px;
    }
    
    /* Remove hover effects */
    .btn:hover,
    .kpi-card:hover,
    .chart-card:hover {
        transform: none;
    }
}

/* =============================================================================
   LANDSCAPE MOBILE
   ============================================================================= */

@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        padding: 2rem 0;
    }
    
    .chart-body {
        height: 180px;
    }
    
    .profit-hero {
        grid-template-columns: 1fr 1fr;
    }
}

/* =============================================================================
   ACCESSIBILITY
   ============================================================================= */

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    [data-animate] {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .kpi-card,
    .chart-card,
    .profit-card {
        border-width: 2px;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* =============================================================================
   UTILITY CLASSES
   ============================================================================= */

/* Hide on specific breakpoints */
.hide-mobile {
    display: none !important;
}

@media (min-width: 768px) {
    .hide-mobile {
        display: initial !important;
    }
    
    .hide-tablet {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    .hide-tablet {
        display: initial !important;
    }
    
    .hide-desktop {
        display: none !important;
    }
}

/* Show only on specific breakpoints */
.show-mobile-only {
    display: block !important;
}

@media (min-width: 768px) {
    .show-mobile-only {
        display: none !important;
    }
}

.show-tablet-only {
    display: none !important;
}

@media (min-width: 768px) and (max-width: 1023px) {
    .show-tablet-only {
        display: block !important;
    }
}

/* Text alignment responsive */
@media (max-width: 767px) {
    .text-center-mobile {
        text-align: center;
    }
}
