/* Base styling */
body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    background-color: #4b5461;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Pokédex Container */
.pokedex-container {
    width: 90%;
    max-width: 1000px;
    height: 80vh; /* Reverted to original height */
    max-height: 600px; /* Reverted to original max-height */
    background-color: #1fd612; /* Classic Pokédex red */
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    padding: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 5px solid #00a703;
}

.pokedex-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #00a703;
}

.pokedex-header h1 {
    color: #fff;
    margin: 0;
    font-size: 28px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.indicator-light {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #4aa6ff;
    margin-left: 15px;
    border: 2px solid #fff;
    box-shadow: 0 0 10px #4aa6ff;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Pokédex Main Content */
.pokedex-content {
    display: flex;
    flex: 1;
    background-color: #333;
    border-radius: 10px;
    overflow: hidden;
    border: 3px solid #00a703;
}

/* Left side: Plant wheel */
.plant-wheel-container {
    flex: 0 0 45%;
    background-color: #222;
    padding: 15px;
    display: flex;
    flex-direction: column;
    position: relative;
    border-right: 3px solid #00a703;
}

.plant-wheel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.plant-image-container {
    position: absolute;
    width: 100%;
    height: 70%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
    padding: 0 5px; /* Add some padding to prevent images from touching edges */
}

.plant-image-container.prev-plant,
.plant-image-container.next-plant {
    opacity: 0.2;
}

.plant-image-container.prev-plant {
    transform: translateY(-100%) scale(0.7);
}

.plant-image-container.current-plant {
    transform: translateY(0) scale(1);
    z-index: 2;
}

.plant-image-container.next-plant {
    transform: translateY(100%) scale(0.7);
}

.plant-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.wheel-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.wheel-btn {
    width: 40px;
    height: 40px;
    background-color: #444;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #666;
    transition: background-color 0.2s;
}

.wheel-btn:hover {
    background-color: #555;
}

.wheel-btn:active {
    background-color: #333;
    transform: scale(0.95);
}

/* Right side: Plant info - adjust width to ensure text fits */
.plant-info-container {
    flex: 0 0 55%;
    background-color: #e8e8e8;
    padding: 15px 12px; /* Reduced horizontal padding */
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Plant details overlay - A separate element that covers the entire Pokédex */
.plant-details-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2); /* Semi-transparent background */
    z-index: 20; /* Higher than any other element */
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: 15px;
}

/* Plant details view - inside the overlay */
.plant-details-view {
    width: 95%;
    height: 95%;
    background-color: #e8e8e8;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    border: 3px solid #00a703; /* Match the main content border */
    transform: scale(0.9); /* Start slightly smaller */
    opacity: 0; /* Start transparent */
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.plant-details-overlay.active {
    display: flex;
}

.plant-details-overlay.active .plant-details-view {
    transform: scale(1); /* Scale to normal size */
    opacity: 1; /* Fade in */
}

/* Improve layout for full-screen details view */
.plant-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ccc;
    max-width: 100%;
    box-sizing: border-box;
}

.plant-image-small {
    width: 100px; /* Larger image */
    height: 100px;
    min-width: 100px;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    margin-right: 20px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.plant-name {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 24px; /* Larger font since we have more space */
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.plant-latin-name {
    margin: 0;
    font-style: italic;
    color: #666;
    font-size: 16px; /* Larger font */
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Layout for the details content in full screen */
.plant-details {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 0 5px;
    margin-bottom: 15px;
    max-width: 100%;
    box-sizing: border-box;
}

/* Make sure the plant sections align well */
.plant-section {
    flex: 1 1 45%; /* Two columns on larger screens */
    margin-bottom: 20px;
    min-width: 250px;
    padding: 0 5px; /* Add a little padding */
}

.plant-section h3 {
    margin: 0 0 10px 0;
    color: #444;
    font-size: 18px; /* Larger font */
    border-left: 4px solid #1fd612;
    padding-left: 10px;
    white-space: normal;
}

.plant-section p {
    margin: 0;
    line-height: 1.6;
    color: #222;
    font-size: 15px; /* Larger font */
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    white-space: normal;
    text-align: justify;
    letter-spacing: normal; /* Normal letter spacing since we have more space */
}

/* Position back button at the bottom center */
.back-to-list-btn {
    margin: 15px auto 10px auto; /* Center horizontally */
    padding: 10px 20px;
    background-color: #1fd612;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.2s, transform 0.1s;
    display: block; /* Make it block to allow margin auto */
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

/* Plant list view */
.plant-list-view {
    height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
}

.plant-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.plant-list li {
    padding: 12px 15px;
    border-bottom: 1px solid #ccc;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 16px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.plant-list li:hover {
    background-color: #d0d0d0;
}

.plant-list li.active {
    background-color: #c3e6ff;
    font-weight: bold;
}

/* Home link */
.home-link-container {
    position: absolute;
    bottom: 15px;
    right: 15px;
    margin: 0;
    z-index: 6; /* Ensure it's above the keyboard controls */
}

.home-link {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    padding: 5px 10px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    transition: background-color 0.3s;
}

.home-link:hover {
    background-color: rgba(0, 0, 0, 0.4);
}

/* Hide the plant data container */
#plant-data {
    display: none;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #ddd;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #00b330;
    border-radius: 4px;
}

/* Update the responsive styles for the full-screen detail view */
@media (max-width: 768px) {
    .plant-details {
        flex-direction: column;
    }
    
    .plant-section {
        flex: 1 1 100%;
        min-width: 0;
    }
    
    .plant-image-small {
        width: 80px;
        height: 80px;
        min-width: 80px;
    }
    
    .plant-name {
        font-size: 20px;
    }
    
    .plant-latin-name {
        font-size: 14px;
    }
    
    .plant-section h3 {
        font-size: 16px;
    }
    
    .plant-section p {
        font-size: 14px;
    }
}

/* Additional responsive adjustments */
@media (max-width: 480px) {
    .pokedex-header h1 {
        font-size: 24px; /* Smaller header on very small screens */
    }
    
    .plant-header {
        flex-direction: column; /* Stack image and name on very small screens */
        align-items: flex-start;
    }
    
    .plant-image-small {
        margin-bottom: 10px;
    }
    
    .plant-section h3 {
        font-size: 15px;
    }
    
    .plant-section p {
        font-size: 12px;
    }
}

/* Plant names container */
.plant-names {
    flex: 1;
    overflow: hidden; /* Prevent names from overflowing */
}

/* Back button hover effects */
.back-to-list-btn:hover {
    background-color: #14c500;
    transform: translateY(-2px); /* Slight lift effect on hover */
}

.back-to-list-btn:active {
    transform: translateY(0);
}

/* Responsive adjustments for main Pokédex container */
@media (max-width: 768px) {
    .pokedex-container {
        width: 95%;
        height: 90vh;
        max-height: none; /* Remove max-height on mobile */
    }
    
    .pokedex-content {
        flex-direction: column;
    }
    
    .plant-wheel-container {
        flex: 0 0 35%; /* Reduced slightly to give more space to plant info */
        border-right: none;
        border-bottom: 3px solid #00b330;
    }
    
    .plant-info-container {
        flex: 0 0 65%; /* Increased to give more space to content */
    }
    
    /* Make overlay take up more space on mobile */
    .plant-details-overlay {
        padding: 10px;
    }
    
    .plant-details-view {
        width: 98%;
        height: 98%;
        padding: 15px;
    }
}

/* Additional responsive adjustments for very small screens */
@media (max-width: 480px) {
    .plant-details-view {
        padding: 10px;
    }
    
    .back-to-list-btn {
        padding: 8px 15px;
        font-size: 14px;
    }
}

/* Keyboard controls guide */
.keyboard-controls {
    position: absolute;
    bottom: 45px; /* Position above the home link */
    right: 15px;
    display: flex;
    gap: 6px;
    background-color: rgba(0, 0, 0, 0.35);
    border-radius: 6px;
    padding: 5px 7px;
    z-index: 5;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.key-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 3px;
}

.key-group:last-child {
    margin-right: 0;
}

.keys {
    display: flex;
    margin-bottom: 2px;
}

.key {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
    background-color: #444;
    color: white;
    border-radius: 3px;
    font-family: monospace;
    font-weight: bold;
    font-size: 11px;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
    border: 1px solid #555;
    margin: 0 1px;
    user-select: none;
}

.key-label {
    color: white;
    font-size: 9px;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Hide controls on mobile (touch interfaces) */
@media (max-width: 768px) {
    .keyboard-controls {
        display: none;
    }
} 