/* Responsive Design */

/* Tablet styles */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
        border-radius: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .control-panel {
        padding: 20px;
    }

    /* Fish Cards Responsive - Tablet */
    .fish-cards-container {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
        max-height: 280px;
        padding: 8px;
    }

    .fish-card {
        padding: 10px 6px;
        min-height: 75px;
    }

    .fish-card-image {
        width: 22px;
        height: 22px;
        margin-bottom: 5px;
    }

    .fish-card-name {
        font-size: 0.8rem;
    }

    .quality-selector {
        gap: 8px;
    }

    .quality-btn {
        min-width: 100px;
        padding: 10px 6px;
    }

    .quality-icon {
        font-size: 1rem;
    }

    .quality-btn span:last-child {
        font-size: 0.8rem;
    }

    .profession-selector {
        gap: 10px;
    }

    .radio-label {
        min-width: 120px;
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .result-panel {
        padding: 25px;
    }

    .recommendation-icon {
        font-size: 2.5rem;
    }

    .recommendation-text {
        font-size: 1.3rem;
    }

    .price-comparison {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .batch-controls {
        flex-direction: column;
        gap: 15px;
    }

    .filter-group,
    .sort-group {
        justify-content: space-between;
    }

    .fish-table th,
    .fish-table td {
        padding: 10px 8px;
        font-size: 0.9rem;
    }
}

/* Mobile styles */
@media (max-width: 480px) {
    body {
        background: #667eea;
    }

    .container {
        margin: 5px;
        padding: 10px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.98);
    }

    header {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    header h1 {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .control-panel {
        padding: 15px;
        margin-bottom: 20px;
    }

    .input-group {
        margin-bottom: 15px;
    }

    .input-group label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    #fish-search {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    /* Fish Cards Responsive */
    .fish-cards-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
        max-height: 250px;
        padding: 8px;
    }

    .fish-card {
        padding: 10px 6px;
        min-height: 70px;
    }

    .fish-card-image {
        width: 20px;
        height: 20px;
        margin-bottom: 4px;
    }

    .fish-card-name {
        font-size: 0.8rem;
    }

    .quality-selector {
        flex-direction: column;
        gap: 8px;
    }

    .quality-btn {
        flex-direction: row;
        justify-content: center;
        min-width: auto;
        width: 100%;
        padding: 12px;
        gap: 8px;
    }

    .quality-icon {
        font-size: 1.1rem;
    }

    .quality-btn span:last-child {
        font-size: 0.9rem;
    }

    .profession-selector {
        flex-direction: column;
        gap: 8px;
    }

    .radio-label {
        min-width: auto;
        width: 100%;
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .quantity-input {
        width: 100px;
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .result-panel {
        padding: 20px;
        margin-bottom: 20px;
    }

    .recommendation-icon {
        font-size: 2rem;
    }

    .recommendation-text {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }

    .calculation-details {
        margin-top: 15px;
        padding-top: 15px;
    }

    .price-comparison {
        gap: 10px;
    }

    .price-item {
        padding: 10px 12px;
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }

    .price-item .label {
        font-size: 0.9rem;
    }

    .price-item .value {
        font-size: 1rem;
    }

    .batch-view-toggle {
        margin-bottom: 20px;
    }

    .toggle-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        width: 100%;
    }

    .batch-view {
        padding: 15px;
    }

    .batch-controls {
        gap: 12px;
    }

    .filter-group,
    .sort-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        width: 100%;
    }

    .filter-group select,
    .sort-group select {
        width: 100%;
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .fish-table-container {
        border-radius: 6px;
    }

    .fish-table {
        font-size: 0.8rem;
    }

    .fish-table th {
        padding: 12px 6px;
        font-size: 0.8rem;
    }

    .fish-table td {
        padding: 10px 6px;
        font-size: 0.8rem;
    }

    .fish-table .fish-name {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .recommendation-badge {
        padding: 3px 6px;
        font-size: 0.7rem;
    }

    /* Related Tools Responsive - Mobile */
    .related-tools-section {
        padding: 15px;
        margin-top: 20px;
        margin-bottom: 15px;
    }

    .related-tools-title {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }

    .related-tools-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .tool-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 15px;
    }

    .tool-icon {
        font-size: 2rem;
        width: 50px;
        height: 50px;
    }

    .tool-name {
        font-size: 1.1rem;
        margin-bottom: 6px;
    }

    .tool-description {
        font-size: 0.9rem;
    }

    .tool-link-indicator {
        font-size: 1.2rem;
    }

    footer {
        margin-top: 20px;
        padding-top: 15px;
        font-size: 0.9rem;
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .container {
        margin: 2px;
        padding: 8px;
    }

    header h1 {
        font-size: 1.6rem;
    }

    .control-panel {
        padding: 12px;
    }

    .result-panel {
        padding: 15px;
    }

    .recommendation-icon {
        font-size: 1.8rem;
    }

    .recommendation-text {
        font-size: 1.1rem;
    }

    .price-item {
        padding: 8px 10px;
    }

    .batch-view {
        padding: 12px;
    }

    .fish-table th,
    .fish-table td {
        padding: 8px 4px;
        font-size: 0.75rem;
    }

    .fish-table .fish-name {
        max-width: 60px;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        margin-top: 10px;
        margin-bottom: 10px;
    }

    header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    header h1 {
        font-size: 1.8rem;
        margin-bottom: 5px;
    }

    .control-panel {
        padding: 15px;
        margin-bottom: 15px;
    }

    .result-panel {
        padding: 20px;
        margin-bottom: 15px;
    }

    .recommendation-icon {
        font-size: 2rem;
        margin-bottom: 8px;
    }

    .recommendation-text {
        font-size: 1.2rem;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .container {
        box-shadow: none;
        background: white;
        margin: 0;
        padding: 20px;
    }

    .control-panel,
    .batch-view-toggle {
        display: none;
    }

    .result-panel {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .batch-view {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .fish-table {
        border: 1px solid #ddd;
    }

    .fish-table th {
        background: #f5f5f5 !important;
        color: black !important;
    }

    .toggle-btn {
        display: none;
    }

    footer a {
        color: black;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .container {
        background: white;
        border: 2px solid black;
    }

    .control-panel {
        background: #f0f0f0;
        border: 1px solid black;
    }

    .result-panel,
    .batch-view {
        background: white;
        border: 1px solid black;
    }

    .quality-btn,
    .radio-label,
    #fish-search,
    #fish-select,
    .quantity-input {
        border: 2px solid black;
    }

    .quality-btn.active {
        background: black;
        color: white;
    }

    .toggle-btn {
        background: black;
        color: white;
        border: 2px solid black;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .quality-btn:hover,
    .toggle-btn:hover {
        transform: none;
    }
}
