* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

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

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

main:not(.main-content) {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
    align-items: start; /* Allow natural heights instead of stretching */
}

@media (min-width: 768px) {
    main:not(.main-content) {
        grid-template-columns: 2fr 1fr;
        align-items: start; /* Allow natural heights instead of stretching */
    }
}

.main-content {
    display: block;
}

.calculator-card,
.info-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.calculator-card h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.calculator-form {
    display: block;
}

.calculate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    margin-bottom: 0;
}

.calculator-card h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.calculator-form {
    display: block; /* Changed from flex to block */
}

.calculator-form > .input-group,
.calculator-form > .drop-quantity-section,
.calculator-form > .time-range-section {
    margin-bottom: 20px;
}

.calculator-form > .calculate-btn {
    margin-top: 0;
    margin-bottom: 0;
}

/* Remove all gap-related styles that were causing issues */
.calculator-form > .input-group:last-of-type {
    margin-bottom: 20px; /* Maintain spacing before button */
}

/* Completely hide sections without any space reservation */
.drop-quantity-section[style*="display: none"],
.time-range-section[style*="display: none"] {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.input-group input {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Time Input Group Styles */
.time-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-input-group input {
    width: 60px;
    text-align: center;
}

.time-input-group span {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

/* Disabled input styles */
input.disabled,
input:disabled {
    background-color: #f7fafc;
    color: #a0aec0;
    border-color: #e2e8f0;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-text {
    flex: 1;
    line-height: 1.4;
}

.drop-quantity-section {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.drop-quantity-section[style*="display: none"] {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

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

.drop-quantity-section .input-group:last-child {
    margin-bottom: 0;
}

.time-range-section {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.time-range-section[style*="display: none"] {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

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

.time-range-section .input-group:last-child {
    margin-bottom: 0;
}

.calculate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    margin-bottom: 0;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.calculate-btn:active {
    transform: translateY(0);
}

.results-section {
    margin-top: 0; /* Removed margin-top to eliminate white space */
    padding: 20px;
    background: #f7fafc;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.results-section:not(.show) {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
}

.results-section.show {
    margin-top: 25px; /* Only add margin when visible */
}

.results-section h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item .label {
    font-weight: 600;
    color: #4a5568;
}

.result-item .value {
    font-weight: 700;
    color: #667eea;
    text-align: right;
}

.info-card {
    height: fit-content;
}

.info-card h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.info-card ul {
    list-style: none;
    margin-bottom: 15px;
}

.info-card li {
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.info-card li:last-child {
    border-bottom: none;
}

.note {
    background: #fef5e7;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #f6ad55;
    font-size: 0.9rem;
    line-height: 1.5;
}

.smart-autofill-note {
    margin-bottom: 20px;
}

footer {
    text-align: center;
    margin-top: 30px;
    color: white;
    opacity: 0.8;
}

footer .disclaimer {
    margin-top: 10px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

/* Animation for results appearance */
.results-section.show {
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsiveness */
@media (max-width: 767px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .calculator-card,
    .info-card {
        padding: 20px;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .result-item .value {
        text-align: left;
        font-size: 1.1rem;
    }
}

/* Library Styles */
.browse-library-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    width: 100%;
}

.browse-library-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

.item-info-card {
    background: #f0f9ff;
    border: 2px solid #0ea5e9;
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    animation: slideInUp 0.3s ease-out;
}

.item-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.item-info-header h4 {
    margin: 0;
    color: #0f172a;
    font-size: 1.2rem;
}

.rarity-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.rarity-badge.common {
    background: #d1d5db;
    color: #374151;
}

.rarity-badge.rare {
    background: #dbeafe;
    color: #1e40af;
}

.rarity-badge.epic {
    background: #fde68a;
    color: #92400e;
}

.rarity-badge.legendary {
    background: #fecaca;
    color: #dc2626;
}

.item-info-content p {
    margin: 5px 0;
    color: #475569;
}

.farming-strategy {
    background: #ecfdf5;
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #10b981;
    margin-top: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.view-all-btn {
    background: #0ea5e9;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.view-all-btn:hover {
    background: #0284c7;
}

/* Library Modal Styles */
.library-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #e2e8f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.3s ease;
}

.close-btn:hover {
    opacity: 0.8;
}

.modal-body {
    padding: 25px;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

.library-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.library-filters select {
    flex: 1;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
}

.library-items {
    display: grid;
    gap: 15px;
}

.library-item {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.library-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.library-item .item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.library-item .item-header h4 {
    margin: 0;
    color: #1e293b;
}

.library-item .item-details p {
    margin: 3px 0;
    color: #64748b;
    font-size: 0.9rem;
}

.locations-list {
    display: grid;
    gap: 15px;
}

.location-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.location-card:hover {
    border-color: #10b981;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.2);
}

.location-card h4 {
    margin: 0 0 10px 0;
    color: #1e293b;
    font-size: 1.2rem;
}

.location-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.location-stats p {
    margin: 0;
    color: #475569;
    font-size: 0.9rem;
}

.location-strategy {
    background: #ecfdf5;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #10b981;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #065f46;
}

/* Mobile Responsiveness for Library */
@media (max-width: 767px) {
    .library-modal {
        padding: 10px;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-body {
        padding: 15px;
    }
    
    .library-filters {
        flex-direction: column;
    }
    
    .location-stats {
        grid-template-columns: 1fr;
    }
    
    .item-info-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Navigation Styles */
.main-nav {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 15px;
}

.nav-link {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.nav-link.active {
    background: white;
    color: #667eea;
    border-color: white;
}

/* Library Page Styles */
.library-controls {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin: 0 auto 30px;
    max-width: 800px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.search-section {
    margin-bottom: 20px;
}

.search-container {
    position: relative;
    display: flex;
    gap: 10px;
}

.autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-container input {
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-button {
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.search-suggestions,
.suggestions-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 6px;
    margin: 2px 4px;
}

.suggestion-item:hover {
    background-color: #f1f5f9;
    transform: translateX(2px);
}

.suggestion-item.highlighted {
    background-color: #dbeafe;
    border-left: 3px solid #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
    transform: translateX(4px);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.suggestion-name {
    font-weight: 600;
    color: #1e293b;
}

.suggestion-category {
    font-size: 0.9rem;
    color: #64748b;
}

/* Search Results Section */
.search-results {
    margin-top: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 5px;
}

.results-header h3 {
    color: white;
    font-size: 1.5rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.results-header span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.results-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:hover {
    background-color: #f8fafc;
}

.result-main {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.result-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.result-info {
    flex: 1;
}

.result-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.result-details {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #64748b;
}

.result-category {
    display: flex;
    align-items: center;
    gap: 5px;
}

.result-location {
    display: flex;
    align-items: center;
    gap: 5px;
}

.result-actions {
    display: flex;
    gap: 10px;
}

.result-button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.use-calculator-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.use-calculator-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

.view-details-btn {
    background: #e2e8f0;
    color: #475569;
}

.view-details-btn:hover {
    background: #cbd5e1;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.no-results h4 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    color: #334155;
}

.no-results p {
    margin: 0;
    font-size: 1rem;
}

/* Item Page Styles */
.item-details-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.item-title-section {
    flex: 1;
}

.item-title {
    margin: 0 0 15px 0;
    font-size: 2.5rem;
    color: #1e293b;
    text-shadow: none;
}

.item-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.item-actions-header {
    display: flex;
    align-items: flex-start;
}

.use-calculator-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.use-calculator-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.item-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.item-description,
.farming-locations,
.farming-tips,
.related-items {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.item-description h3,
.farming-locations h3,
.farming-tips h3,
.related-items h3 {
    margin: 0 0 15px 0;
    color: #1e293b;
    font-size: 1.3rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.item-description p {
    margin: 0;
    line-height: 1.6;
    color: #475569;
    font-size: 1.1rem;
}

.location-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.location-card:last-child {
    margin-bottom: 0;
}

.location-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.location-card.best-location {
    border-color: #fbbf24;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.best-badge {
    background: #f59e0b;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 10px;
}

.location-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.location-name {
    margin: 0;
    color: #1e293b;
    font-size: 1.3rem;
}

.use-location-btn {
    padding: 8px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.use-location-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.location-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.stat {
    text-align: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
}

.stat-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.1rem;
    color: #1e293b;
    font-weight: 700;
}

.location-strategy {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3b82f6;
    padding: 10px 12px;
    border-radius: 0 8px 8px 0;
    margin-top: 10px;
    color: #1e40af;
}

.farming-tips ul {
    margin: 0;
    padding-left: 20px;
}

.farming-tips li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: #475569;
}

.related-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.related-item-link {
    display: block;
    padding: 12px;
    background: #f1f5f9;
    border: 2px solid transparent;
    border-radius: 10px;
    text-decoration: none;
    color: #475569;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

.related-item-link:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    color: #1e293b;
}

/* Error State Styles */
.error-state {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.error-state h2 {
    margin: 0 0 15px 0;
    font-size: 2rem;
}

.error-state p {
    margin: 0 0 30px 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive Design for Item Page */
@media (max-width: 768px) {
    .item-details-container {
        padding: 15px;
    }
    
    .item-header {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    
    .item-actions-header {
        width: 100%;
        justify-content: center;
    }
    
    .item-title {
        font-size: 2rem;
        text-align: center;
    }
    
    .item-meta {
        justify-content: center;
    }
    
    .location-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .location-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .related-items-grid {
        grid-template-columns: 1fr;
    }
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    color: white;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.6;
}

.no-results h4 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: white;
}

.no-results p {
    font-size: 1.1rem;
    opacity: 0.8;
    color: rgba(255, 255, 255, 0.9);
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-section {
    display: flex;
    gap: 15px;
}

.filter-select {
    flex: 1;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.item-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border-color: #667eea;
}

.item-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.item-name {
    margin: 0;
    color: #1e293b;
    font-size: 1.3rem;
}

.category-badge {
    background: #f1f5f9;
    color: #475569;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.item-category {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    margin-bottom: 10px;
}

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

.best-location {
    background: #f0f9ff;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #0ea5e9;
    margin-bottom: 15px;
}

.location-name {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 5px;
}

.location-stats {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #64748b;
}

.item-actions {
    display: flex;
    gap: 10px;
}

.use-in-calculator-btn,
.view-details-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.use-in-calculator-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.use-in-calculator-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.4);
}

.view-details-btn {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.view-details-btn:hover {
    background: #e2e8f0;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.empty-state p {
    color: #718096;
    margin-bottom: 30px;
    max-width: 400px;
    line-height: 1.5;
}

.cta-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.cta-button.secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    margin-left: 10px;
}

.cta-button.secondary:hover {
    background: #edf2f7;
}

.item-meta {
    display: flex;
    gap: 10px;
}

.use-calculator-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.use-calculator-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.item-content > div {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.item-content h3 {
    color: #1e293b;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.location-card {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.location-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.location-card.best-location {
    border-color: #10b981;
    background: #f0fdf4;
}

.best-badge {
    background: #10b981;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 10px;
}

.location-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.location-name {
    margin: 0;
    color: #1e293b;
    font-size: 1.2rem;
}

.use-location-btn {
    background: #0ea5e9;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.use-location-btn:hover {
    background: #0284c7;
}

.location-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.stat {
    text-align: center;
}

.stat-label {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.error-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Browse Library Button Update */
.browse-library-btn {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 15px;
    width: 100%;
    display: block;
    text-align: center;
}

.browse-library-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(14, 165, 233, 0.4);
}

/* Responsive Design Updates */
@media (max-width: 767px) {
    .main-nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-section {
        flex-direction: column;
    }
    
    .library-grid {
        grid-template-columns: 1fr;
    }
    
    .item-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .item-title {
        font-size: 2rem;
    }
    
    .location-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .location-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .error-actions {
        flex-direction: column;
        align-items: center;
    }
}

/* Homepage Styles */
.hero-header {
    text-align: center;
    padding: 60px 0 40px;
    color: white;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin: 15px 0 10px;
    font-weight: 600;
    opacity: 0.95;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.main-content {
    margin-bottom: 40px;
}

/* FEATURES SECTION STYLES */
.features-section {
    margin: 60px 0;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.features-section.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.features-section h2 {
    text-align: center;
    color: white;
    font-size: 2.2rem;
    margin-bottom: 50px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.features-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.feature-block {
    display: flex;
    align-items: center;
    gap: 40px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

/* All feature blocks now have uniform layout with icon on the left */

.feature-block:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    border-color: rgba(102, 126, 234, 0.3);
}

.feature-icon {
    font-size: 5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.feature-content {
    flex: 1;
}

.feature-content h3 {
    color: #1e293b;
    font-size: 2rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.feature-content p {
    color: #64748b;
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 25px;
}

.feature-button {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.feature-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
}

.quick-start-steps {
    display: grid;
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.step {
    background: white;
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.step:hover {
    transform: translateX(10px);
}

.step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h4 {
    color: #1e293b;
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.step-content p {
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

.cta-section {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.cta-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 100%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.cta-card h2 {
    color: #1e293b;
    font-size: 2rem;
    margin-bottom: 15px;
}

.cta-card p {
    color: #64748b;
    font-size: 1.1rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

.cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-button.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.cta-button.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.stat-item {
    background: white;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
    display: block;
}

.stat-label {
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.homepage-footer {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    margin-top: 60px;
    overflow: hidden;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding: 40px;
}

.footer-section h4 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section li {
    margin-bottom: 8px;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.footer-bottom .disclaimer {
    margin-top: 10px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

/* Mobile Responsiveness for Homepage */
@media (max-width: 767px) {
    .hero-header {
        padding: 40px 0 30px;
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .features-container {
        gap: 40px;
    }
    
    .feature-block {
        flex-direction: column !important;
        text-align: center;
        gap: 25px;
        padding: 30px 25px;
    }
    
    .feature-icon {
        width: 100px;
        height: 100px;
        font-size: 4rem;
    }
    
    .feature-content h3 {
        font-size: 1.7rem;
    }
    
    .feature-content p {
        font-size: 1rem;
    }
    
    .feature-card {
        padding: 25px;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .step:hover {
        transform: none;
    }
    
    .cta-card {
        padding: 30px 25px;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 30px 25px;
    }
}