/* --- Global Styles --- */
html, body {
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #eee;
}

body {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    position: relative;
    z-index: 0;
    background: linear-gradient(135deg, #2b2b2b 0%, #444 50%, #2b2b2b 100%);
    min-height: 100vh;
    overflow-y: hidden;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: grayscale(100%);
    opacity: 0.8;
    z-index: -1;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 10px; height: 10px;
}
::-webkit-scrollbar-track {
    background: #2b2b2b; border-radius: 5px;
}
::-webkit-scrollbar-thumb {
    background-color: #007acc; border-radius: 5px; border: 2px solid #2b2b2b;
}
::-webkit-scrollbar-thumb:hover {
    background-color: #00a8ff;
}
::-webkit-scrollbar-corner {
    background: #222;
}


/* --- Main Content Wrapper --- */
.main-content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    padding-top: 95px;
    padding-bottom: 95px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    min-height: 0;
}


/* --- Main Page Container --- */
.page-specific-content-area {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    max-width: 1650px;
	width: 85%;
    margin: 0 auto;
    padding: 10px 40px;
    background-color: #2a2a2a;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    text-align: left;
    position: relative;
    z-index: 1;
    min-height: 0;
    border: 2px solid black;
	margin-bottom: -90px; 
}
.page-specific-content-area h2 {
    color: #00a8ff;
    text-align: center;
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 10px;
}
.page-specific-content-area p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 25px;
    text-align: center;
}

/* --- Travel Page Layout --- */
.travel-layout-container {
    display: grid;
    grid-template-columns: 30% 1fr;
    gap: 30px;
    margin-top: 25px;
    min-height: 0;
    width: 100%;
}

/* --- Left Panel --- */
.left-panel {
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
    padding-right: 15px;
    box-sizing: border-box;
    min-height: 0;
    transform: translateY(-25px);
}
.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: hidden;
    padding-left: 15px;
    box-sizing: border-box;
    min-height: 0;
    transform: translateY(-25px);
}

/* --- Input Section (Left Panel) --- */
.input-section {
    padding: 20px;
    border: 2px solid black;
    border-radius: 8px;
    background-color: #2e2e2e;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
    flex-grow: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    gap: 15px;
}
.input-section label {
    display: block;
    margin-bottom: 0;
    font-weight: bold;
    color: #00a8ff;
    font-size: 1.05rem;
}
.input-section select,
.input-section input[type="text"],
.input-section input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 0;
    border: 1px solid black;
    border-radius: 5px;
    box-sizing: border-box;
    background-color: #383838;
    color: #eee;
    font-size: 0.95rem;
	margin-top: 4px;
}
.input-section hr {
    width: 100%;
    border: none;
    border-top: 1px solid black;
    margin: 0;
}
.input-section p {
    margin: 0;
    font-size: 0.85rem;
    color: #bbb;
    line-height: 1.4;
    text-align: left;
}
.input-section select:focus,
.input-section input[type="text"]:focus,
.input-section input[type="number"]:focus {
    outline: none;
    border-color: #0086d1;
    box-shadow: 0 0 10px rgba(0, 168, 255, 0.6);
}
.input-section p a {
    color: #00a8ff;
    text-decoration: none;
}
.input-section p a:hover {
    text-decoration: underline;
}

.travel-perks-section {
    padding: 15px;
    border: 1px solid black;
    border-radius: 5px;
    background-color: #383838; /* Match input field background */
}
.travel-perks-section > label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #00a8ff; /* Match other labels */
    font-size: 1.05rem;
}
.perk-option {
    display: flex;
    align-items: center;
    margin-bottom: 10px; /* Space out the options a bit */
    font-size: 0.95rem;
}
.perk-option:last-child {
    margin-bottom: 0; /* Remove margin from the last item */
}
.perk-option input[type="checkbox"] {
    margin-right: 10px;
    width: 15px; 
    height: 15px;
}
.perk-option label, .perk-option select {
   color: #ccc;
}
.perk-option select {
    margin-left: 8px;
    background-color: #2e2e2e;
    border: 1px solid black;
    color: #eee;
    padding: 4px 6px;
    border-radius: 3px;
    flex-grow: 1;
}

/* --- Custom Button Styles --- */
.input-section .button-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.input-section .btn-header {
    background-color: #007acc;
    color: white;
    padding: 8px 15px;
    border: 1px solid black;
    border-radius: 5px;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    height: 35px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.input-section .btn-header:hover {
    background-color: #00a8ff;
}

#clear-data-btn {
    background-color: #d9534f;
}

#clear-data-btn:hover {
    background-color: #c9302c;
}

/* --- Item List Section (Right Panel) --- */
.item-list-section {
    position: relative; /* ADDED FOR OVERLAY POSITIONING */
    padding: 20px;
    border: 2px solid black;
    border-radius: 8px;
    background-color: #2e2e2e;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
    flex-grow: 1;
    min-height: 0;
    box-sizing: border-box;
    overflow-y: auto;
}

/* UPDATED LOADING INDICATOR AS OVERLAY */
#loading-indicator {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(46, 46, 46, 0.85);
    color: #00a8ff;
    z-index: 10;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    font-weight: bold;
}

.error-message {
    display: none;
    color: #ff6b6b;
    font-weight: bold;
    padding: 12px 20px;
    background-color: rgba(255, 107, 107, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 107, 0.3);
    text-align: center;
    margin: 0 0 15px 0; /* Adjusted margin */
}

.item-list-section h2 {
    text-align: center;
    color: #00a8ff;
    margin-top: -10px;
    margin-bottom: 25px;
}
#selected-country-name {
    color: #00a8ff;
    font-weight: bold;
}
#item-list p {
    text-align: center;
    color: #bbb;
    font-style: italic;
    padding: 15px;
    background-color: #2e2e2e;
    border-radius: 8px;
    border: 1px dashed black;
}

/* --- Item Card Styles --- */
.item-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: #333;
    border: 1px solid ;
    margin-bottom: 15px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
	border-radius: 10px;
}
.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 168, 255, 0.4);
    background-color: #3a3a3a;
}
.item-card img {
    width: 60px;
    height: 60px;
    border-radius: 5px;
    object-fit: contain;
    background-color: #4a4a4a;
    padding: 5px;
    border: 1px solid #00a8ff;
    flex-shrink: 0;
}
.item-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.item-info h3 {
    margin: 0;
    color: #eee;
    font-size: 1.1rem;
}
.item-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 20px;
    font-size: 0.9rem;
    color: #ccc;
}
.item-stats span {
    display: block;
}
.item-stats strong {
    color: #00a8ff;
    margin-right: 5px;
}
.profit-summary {
    font-weight: bold;
    color: #2ecc71;
    font-size: 1rem;
    margin: 0;
    text-align: left;
}

#clear-data-btn .tablet-text {
    display: none;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    body { padding-top: 0; padding-bottom: 0; overflow-y: auto; }
    header { position: static; height: auto; min-height: 70px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; justify-content: center; }
    .header-left, .header-center, .header-right-controls { flex-basis: auto; width: 100%; justify-content: center; margin-bottom: 5px; }
    #headerMainLogo { max-height: 50px; margin-top: 0; }
    .header-left h1 { font-size: 1.4rem; }
    .tagline { font-size: 0.7rem; }
    .btn-header, .header-text-link { padding: 6px 10px; font-size: 0.85rem; height: auto; }

    .main-content-wrapper {
        padding-top: 10px;
        padding-bottom: 10px;
        height: auto;
        min-height: unset;
        overflow: visible;
    }
    .page-specific-content-area {
        padding: 20px;
		margin-top: 90px !important;
		margin-bottom: 60px !important;
    }
    .travel-layout-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .left-panel, .right-panel {
        transform: none;
        padding-left: 0;
        padding-right: 0;
    }
    .item-list-section {
        overflow-y: visible;
    }
}

@media (max-width: 480px) {
    .header-left h1 { font-size: 1.2rem; }
    .header-left .tagline { display: none; }
    .page-specific-content-area { margin: 10px; padding: 15px; }
    .page-specific-content-area h2 { font-size: 1.5rem; }
    .input-section {
        padding: 10px;
    }
    .item-card img {
        width: 50px;
        height: 50px;
    }
    .item-stats {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .main-content-wrapper {
        align-items: stretch;
        padding-top: 50px;
        padding-bottom: -40px;
    }
.page-specific-content-area {
	    margin-top: 40px;
        justify-content: flex-start;
        padding-top: 5vh;
		margin-bottom: 20px;
    }
}

/* --- Responsive Button Text for Travel Page --- */
#fetch-data-btn .tablet-text {
    display: none;
}

@media (min-width: 769px) and (max-width: 1024px) {
    #fetch-data-btn .desktop-text {
        display: none;
    }
    #fetch-data-btn .tablet-text {
        display: inline;
    }
    #clear-data-btn .desktop-text {
        display: none;
    }
    #clear-data-btn .tablet-text {
        display: inline;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .input-section {
    padding: 20px;
    border: 2px solid black;
    border-radius: 8px;
    background-color: #2e2e2e;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
    flex-grow: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    gap: 15px;
    width: 202px;
  }
}

@media (min-width: 1025px) {
    .dropdown-wrapper {
        display: flex;
        gap: 20px;
        align-items: flex-start;
    }

    .dropdown-item {
        flex: 1;
    }
}