/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    min-height: 100vh;
    background-image: url('../assets/stardewbackground.png');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    font-weight: 300;
}

/* Control Panel */
.control-panel {
    background: rgba(255, 255, 255, 0.5);
    padding: 24px;
    border-radius: 10px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

/* Fish Selector */
.fish-selector {
    position: relative;
}

#fish-search {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
}

#fish-search:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Fish Cards Container */
.fish-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
}

.fish-cards-container:empty::after {
    content: "No fish found";
    grid-column: 1 / -1;
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 20px;
}

/* Fish Card */
.fish-card {
    display: flex;
    /* flex-direction: column; */
    align-items: center;
    padding: 4px 8px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 50px;
    justify-content: center;
}

.fish-card:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.fish-card.selected {
    border-color: #3498db;
    background: #e3f2fd;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.fish-card-image {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.fish-card-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #2c3e50;
    line-height: 1.2;
    word-break: break-word;
}

.fish-card.selected .fish-card-name {
    color: #3498db;
    font-weight: 600;
}

/* Hidden state for filtered cards */
.fish-card.hidden {
    display: none;
}


/* Profession Selector */
.profession-selector {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 140px;
    justify-content: center;
}

.radio-label:hover {
    border-color: #3498db;
    background: #f8f9fa;
}

.radio-label input[type="radio"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.radio-label input[type="radio"]:checked + span {
    font-weight: 600;
    color: #3498db;
}

/* Quantity Input */
.quantity-input {
    width: 120px;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
    transition: border-color 0.3s ease;
}

.quantity-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Result Panel */
.result-panel {
    border-radius: 10px;
    margin-bottom: 25px;
    text-align: center;
}

.recommendation {
    margin-bottom: 20px;
}

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

.recommendation-text {
    font-size: 1.5rem;
    font-weight: 600;
}

.recommendation.profitable {
    color: #27ae60;
}

.recommendation.loss {
    color: #e74c3c;
}

.recommendation.neutral {
    color: #f39c12;
}

/* No Fish Selected State */
.no-fish-selected {
    margin-bottom: 20px;
}

.no-fish-selected .recommendation-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.no-fish-selected .recommendation-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #7f8c8d;
}

/* Quality Results Grid */
.quality-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.quality-result-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.quality-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.quality-result-card.profitable {
    border-color: #27ae60;
    background: linear-gradient(135deg, #d5f4e6 0%, #f8f9fa 100%);
}

.quality-result-card.loss {
    border-color: #e74c3c;
    background: linear-gradient(135deg, #fadbd8 0%, #f8f9fa 100%);
}

.quality-result-card.neutral {
    border-color: #f39c12;
    background: linear-gradient(135deg, #fef9e7 0%, #f8f9fa 100%);
}

.quality-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.quality-header .quality-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.quality-header .quality-icon:not(img) {
    font-size: 1.5rem;
}

.quality-header .quality-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.quality-details {
    margin-bottom: 15px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.price-row:last-child {
    border-bottom: none;
}

.price-row.profit-row {
    font-weight: 600;
    background: rgba(52, 152, 219, 0.1);
    margin: 0 -10px;
    padding: 8px 10px;
    border-radius: 6px;
    border-bottom: none;
}

.price-row.total-row {
    font-weight: 700;
    font-size: 1.1rem;
    background: rgba(231, 76, 60, 0.1);
    margin: 5px -10px 0;
    padding: 10px;
    border-radius: 6px;
    border-bottom: none;
}

.price-row .label {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.9rem;
}

.price-row .value {
    font-weight: 600;
    font-size: 1rem;
}

.quality-recommendation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #e9ecef;
}

.quality-recommendation .recommendation-icon {
    font-size: 1.5rem;
}

.quality-recommendation .recommendation-text {
    font-weight: 600;
    font-size: 0.95rem;
}

.quality-recommendation.profitable {
    background: rgba(39, 174, 96, 0.1);
    border-color: #27ae60;
    color: #27ae60;
}

.quality-recommendation.loss {
    background: rgba(231, 76, 60, 0.1);
    border-color: #e74c3c;
    color: #e74c3c;
}

.quality-recommendation.neutral {
    background: rgba(243, 156, 18, 0.1);
    border-color: #f39c12;
    color: #f39c12;
}

/* Calculation Details */
.calculation-details {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #ecf0f1;
}

.price-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #bdc3c7;
}

.price-item.profit-loss {
    border-left-color: #3498db;
}

.price-item.total-profit {
    border-left-color: #e74c3c;
    font-weight: 600;
    font-size: 1.1rem;
}

.price-item .label {
    font-weight: 500;
    color: #2c3e50;
}

.price-item .value {
    font-weight: 600;
    font-size: 1.1rem;
}

.profit {
    color: #27ae60;
}

.loss {
    color: #e74c3c;
}

.neutral {
    color: #f39c12;
}

/* Batch View Toggle */
.batch-view-toggle {
    text-align: center;
    margin-bottom: 25px;
}

.toggle-btn {
    padding: 12px 25px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Batch View */
.batch-view {
    background: rgba(255, 255, 255, 0.5);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.batch-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group,
.sort-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label,
.sort-group label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0;
}

.filter-group select,
.sort-group select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

/* Fish Table */
.fish-table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.fish-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.fish-table th {
    background: #34495e;
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fish-table td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
    font-size: 0.95rem;
}

.fish-table tbody tr:hover {
    background: #f8f9fa;
}

.fish-table .fish-name {
    font-weight: 600;
    color: #2c3e50;
}

.fish-table .profit {
    color: #27ae60;
    font-weight: 600;
}

.fish-table .loss {
    color: #e74c3c;
    font-weight: 600;
}

.fish-table .neutral {
    color: #f39c12;
    font-weight: 600;
}

.recommendation-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recommendation-badge.yes {
    background: #d5f4e6;
    color: #27ae60;
}

.recommendation-badge.no {
    background: #fadbd8;
    color: #e74c3c;
}

.recommendation-badge.neutral {
    background: #fef9e7;
    color: #f39c12;
}

/* Related Tools Section */
.related-tools-section {
    background: rgba(255, 255, 255, 0.5);
    padding: 25px;
    border-radius: 10px;
    margin-top: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
}

.related-tools-title {
    text-align: center;
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    border-color: #3498db;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.2);
    text-decoration: none;
    color: inherit;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.tool-card:hover .tool-icon {
    background: rgba(52, 152, 219, 0.2);
    transform: scale(1.1);
}

.tool-content {
    flex: 1;
    min-width: 0;
}

.tool-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.tool-card:hover .tool-name {
    color: #3498db;
}

.tool-description {
    font-size: 0.95rem;
    color: #7f8c8d;
    margin: 0;
    line-height: 1.4;
}

.tool-link-indicator {
    font-size: 1.5rem;
    color: #bdc3c7;
    flex-shrink: 0;
    transition: all 0.3s ease;
    font-weight: bold;
}

.tool-card:hover .tool-link-indicator {
    color: #3498db;
    transform: translateX(5px);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
}

footer a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

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

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #3498db;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
