/* -------------------------------------------------------------------
   1. GLOBAL BASE STYLES & WRAPPER
------------------------------------------------------------------- */

@font-face { font-family: Raleway; src: url('Raleway-Regular.ttf'); }
@font-face { font-family: Ralewayblack; src: url('Raleway-Black.ttf'); }
@font-face { font-family: Ralewaybold; src: url('Raleway-Bold.ttf'); }
@font-face { font-family: Ralewaylight; src: url('Raleway-Light.ttf'); }
@font-face { font-family: RalewayMedium; src: url('Raleway-Medium.ttf'); }

* { box-sizing: border-box; }

body {
    font-family: Raleway, sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5;
    color: #555;
    margin: 0;
    padding: 0;
}

.wrapper {
    max-width: 1500px;
    width: 95%;
    min-height: 100vh;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    padding: 20px;
    border-radius: 6px;
    overflow: visible;
}

/* -------------------------------------------------------------------
   2. TOP MENU LINKS
------------------------------------------------------------------- */

.top-menu {
    padding: 10px 0;
    margin-bottom: 20px;
    border-radius: 6px;
}

.top-menu ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.top-menu ul li a {
    color: dimgray;
    text-decoration: none;
    font-family: RalewayMedium, sans-serif;
    font-size: 0.85em;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
}

/* -------------------------------------------------------------------
   3. INDEX/SUBPAGE HEADER & CONTENT STYLING
------------------------------------------------------------------- */

header h1, header h2 {
    font-family: RalewayMedium, sans-serif;
    font-size: 2.5em;
    text-align: center;
    padding: 20px 0;
    margin: 0 0 30px 0;
    border-radius: 6px;
    letter-spacing: 6px;
}

.main-image-container {
    max-width: 1500px;
    margin: 0 auto 40px auto;
    text-align: center;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(0,0,0,0.05);
}

.main-cologne-image {
    width: 100%;
    max-width: 1500px;
    max-height: 450px !important;
    object-fit: cover;
    display: block;
    margin: 0 auto;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.description {
    max-width: 1500px;
    margin: 30px auto;
    padding: 30px;
    background-color: #f0f0f0;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: center;
    color: #666;
}

.description p {
    font-size: 1.1em;
    line-height: 1.7;
    margin: 0;
}

/* -------------------------------------------------------------------
   4. SUBPAGE FILTER DROPDOWNS
------------------------------------------------------------------- */

.cologne-filter-form-wrapper {
    max-width: 1500px;
    margin: 40px auto 20px;
    padding: 0 20px;
    text-align: center;
}

.cologne-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: #f4f4f4;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filter-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    min-width: 150px;
}

.filter-group label {
    font-family: RalewayMedium, sans-serif;
    font-size: 0.95em;
    color: #555;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select {
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    background-color: #fff;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22000000%22%20d%3D%22M287%2069.9L146.2%20208.7L5.4%2069.9z%22/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: 8px auto;
    cursor: pointer;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.filter-group select:focus {
    outline: 2px solid rgba(0,0,0,0.08);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.03);
}

.clear-filters-link {
    display: inline-block;
    padding: 5px 7px;
    text-decoration: none;
    color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight:bold;
    background-color: gray;
    transition: background-color 0.2s;
}

.clear-filters-link:hover {
    background-color: gray;
    color: white;
}

/* -------------------------------------------------------------------
   5. SUBPAGE TABLE STYLING
------------------------------------------------------------------- */

.cologne-table-container {
    max-width: 1600px;
    margin: 40px auto 80px;
    padding: 0 20px;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 600px;
}

.cologne-data-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    background: #fafafa;
    color: #444;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    table-layout: auto; /* let column widths adapt to content */
}

.cologne-data-table th {
    font-family: Ralewaybold, sans-serif;
    font-size: 0.8em;
    letter-spacing: 0.5px;
    padding: 2px 10px;
    text-align: left;
    background-color: #666;
    color: #fff;
}

.cologne-data-table thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 2;
}

.cologne-data-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    font-size: 0.75em;

    white-space: normal;
    word-break: normal;        /* do NOT break words */
    overflow-wrap: normal;     /* wrap only at spaces */
}


.cologne-data-table tbody tr {
    background-color: #fff;
    min-height: 80px;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
}

.cologne-data-table tbody tr:hover {
    background-color: #f7f7f7;
}

/* ---------------- COLUMN WIDTHS REBALANCED ---------------- */

/* Small / fixed columns */
.cologne-data-table th:nth-child(5),
.cologne-data-table td:nth-child(5) { min-width: 140px; } /* Stil slightly wider */
.cologne-data-table th:nth-child(7),
.cologne-data-table td:nth-child(7) { min-width: 120px; }  /* Ett ord */

 /* Text-heavy columns: Doftnoter (8) & Tankar (9) */
.cologne-data-table th:nth-child(8),
.cologne-data-table td:nth-child(8),
.cologne-data-table th:nth-child(9),
.cologne-data-table td:nth-child(9) {
    min-width: 200px;   /* smaller on mobile, reasonable width */
    max-width: 300px;   /* prevents columns from getting too wide */
    width: auto;
}

/* Flexible remaining columns */
.cologne-data-table td:nth-child(1),
.cologne-data-table th:nth-child(1),
.cologne-data-table td:nth-child(2),
.cologne-data-table th:nth-child(2),
.cologne-data-table td:nth-child(3),
.cologne-data-table th:nth-child(3),
.cologne-data-table td:nth-child(4),
.cologne-data-table th:nth-child(4),
.cologne-data-table td:nth-child(6),
.cologne-data-table th:nth-child(6) { width: auto; min-width: 80px; }

/* Tablet adjustments */
@media (max-width: 1024px) {
    .cologne-data-table th:nth-child(5),
    .cologne-data-table td:nth-child(5) { min-width: 130px; }
    
    .cologne-data-table th:nth-child(8),
    .cologne-data-table td:nth-child(8),
    .cologne-data-table th:nth-child(9),
    .cologne-data-table td:nth-child(9) { min-width: 180px; max-width: 250px; }
}

/* Mobile adjustments */
@media (max-width: 700px) {
    .cologne-data-table th:nth-child(5),
    .cologne-data-table td:nth-child(5) { min-width: 120px; }
    
    .cologne-data-table th:nth-child(8),
    .cologne-data-table td:nth-child(8),
    .cologne-data-table th:nth-child(9),
    .cologne-data-table td:nth-child(9) { min-width: 150px; max-width: 220px; }
}


/* -------------------------------------------------------------------
   6. FOOTER
------------------------------------------------------------------- */

.bottom {
    background-color: #888;
    color: #fff;
}

/* -------------------------------------------------------------------
   7. PERFUME MODAL
------------------------------------------------------------------- */

.perfume-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    overscroll-behavior: contain;
    z-index: 9999;
}

.perfume-modal-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 380px;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.perfume-modal-close {
    float: right;
    font-size: 28px;
    cursor: pointer;
}

.perfume-modal-close:hover { color: #000; }

/* -------------------------------------------------------------------
   8. TABLE SORTING
------------------------------------------------------------------- */

#cologneTable thead th.sortable { position: relative; cursor: pointer; }
#cologneTable thead th.sortable::after {
    content: "";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    opacity: 0;
}
#cologneTable thead th.sortable.sort-asc::after { border-bottom-color: #fff; opacity: 1; }
#cologneTable thead th.sortable.sort-desc::after { border-top-color: #fff; opacity: 1; }

/* -------------------------------------------------------------------
   9. RESPONSIVE TWEAKS
------------------------------------------------------------------- */

@media (max-width: 1024px) {
    /* Tablet / horizontal orientation */
    .cologne-data-table th:nth-child(5),
    .cologne-data-table td:nth-child(5),
    .cologne-data-table th:nth-child(7),
    .cologne-data-table td:nth-child(7) { min-width: 90px; }

    .cologne-data-table th:nth-child(8),
    .cologne-data-table td:nth-child(8),
    .cologne-data-table th:nth-child(9),
    .cologne-data-table td:nth-child(9) { min-width: 200px; }
}

@media (max-width: 700px) {
    .cologne-filter-form { gap: 12px; padding: 12px; }
    .filter-group { min-width: 120px; }
    .cologne-data-table { min-width: 600px; }

    /* Mobile portrait/landscape tweaks */
    .cologne-data-table th:nth-child(5),
    .cologne-data-table td:nth-child(5),
    .cologne-data-table th:nth-child(7),
    .cologne-data-table td:nth-child(7) { min-width: 90px; }

    .cologne-data-table th:nth-child(8),
    .cologne-data-table td:nth-child(8),
    .cologne-data-table th:nth-child(9),
    .cologne-data-table td:nth-child(9) { min-width: 200px; }
}


/* Styling for the new Bildinspiration column */




/* Update the 10th column (Bildinspiration) */
.cologne-data-table th:nth-child(10),
.cologne-data-table td:nth-child(10) { 
    min-width: 250px; /* Doubled from 100px */
    text-align: center;
    vertical-align: middle;
}

/* Ensure the image inside scales up to the new width */
.cologne-data-table td:nth-child(10) img {
    width: 100% !important; /* Forces image to fill the 200px width */
    max-width: 230px;        /* Keeps a little padding on the sides */
    height: auto;
    border-radius: 4px;
}



