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

.awards-banner {
    width: 100%;
    margin-bottom: 30px;
}

.awards-banner img,
.awards-banner video {
    width: 100%;
    height: auto;
    display: block;
}

.awards-content h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    text-align: center;
}

.awards-intro {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 40px;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    white-space: pre-line;
}

.awards-intro-image {
    display: block;
    max-width: 60%;
    height: auto;
    margin: 0px auto;
}

.awards-voting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.voting-slot {
    background: var(--card-bg, #f5f5f5);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.lamnia-dark-theme .voting-slot {
    background: var(--card-bg, #2a2a2a);
}

.voting-slot h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
    text-align: center;
}

.product-search {
    position: relative;
    margin-bottom: 15px;
}

.search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-dark, #ddd);
    border-radius: 4px;
    font-size: 1em;
    background: #fff;
    color: #000;
}

.lamnia-dark-theme .search-input {
    background: #1a1a1a;
    color: #fff;
    border-color: #444;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-dark, #ddd);
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.lamnia-dark-theme .search-results {
    background: #2a2a2a;
    border-color: #444;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.search-results.active {
    display: block;
}

.search-results.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 80px;
}

.search-spinner {
    border: 3px solid var(--border-dark, #f3f3f3);
    border-top: 3px solid var(--success-dim, #4CAF50);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-result-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-dark, #eee);
    display: flex;
    align-items: center;
    gap: 10px;
}

.lamnia-dark-theme .search-result-item {
    border-bottom-color: #444;
}

.search-result-item:hover,
.search-result-item.highlighted {
    background: var(--hover-bg, #f0f0f0);
}

.lamnia-dark-theme .search-result-item:hover,
.lamnia-dark-theme .search-result-item.highlighted {
    background: #3a3a3a;
}

.search-result-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.selected-product {
    margin-bottom: 15px;
    min-height: 330px;
}

.selected-product .product-card {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.selected-product.has-product .product-card {
    visibility: visible;
    opacity: 1;
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: alias;
}

.selected-product:not(.has-product) .product-link {
    pointer-events: none;
    cursor: default;
}

.product-link:hover .product-card {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.product-card {
    background: var(--card-bg, #fff);
    padding: 15px;
    border-radius: 4px;
    border: 1px solid var(--success-dim, #4CAF50);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.lamnia-dark-theme .product-card {
    background: #1a1a1a;
}

.product-card img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.product-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-info h3 {
    font-size: 1em;
    margin-bottom: 5px;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    min-height: 3.9em;
}

.product-number {
    color: var(--text-muted, #666);
    font-size: 0.85em;
    margin-top: auto;
    padding-top: 5px;
    min-height: 1.2em;
}

.product-number:empty::before {
    content: '\00a0';
}

.btn-vote {
    width: 100%;
    padding: 12px;
    background: var(--success-dim, #4CAF50);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-vote:disabled {
    background: var(--background-lighter, #ccc);
    cursor: not-allowed;
}

.btn-vote:not(:disabled):hover {
    opacity: 0.9;
}

.btn-vote.voted {
    background: var(--success-color, #2196F3);
}

.vote-status {
    margin-top: 10px;
    text-align: center;
    font-weight: bold;
    min-height: 24px;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.vote-status.success {
    color: var(--success-dim, #4CAF50);
    animation: fadeInPulse 0.5s ease;
}

.vote-status.error {
    color: var(--error, #f44336);
    background-color: rgba(244, 67, 54, 0.15);
    padding: 16px 20px;
    border-radius: 6px;
    border: 2px solid var(--error, #f44336);
    font-size: 15px;
    margin: 15px 0;
    animation: fadeInPulse 0.5s ease;
    display: block;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.2);
}

@keyframes fadeInPulse {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.voucher-section {
    background: var(--card-bg, #f5f5f5);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    margin-top: 40px;
}

.lamnia-dark-theme .voucher-section {
    background: #2a2a2a;
}

.voucher-section h2 {
    font-size: 2em;
    margin-bottom: 15px;
    color: var(--success, #4CAF50);
}

.voucher-display {
    max-width: 600px;
    margin: 20px auto;
}

.voucher-code-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    padding: 20px;
    background: var(--card-content, #fff);
    border: 3px solid var(--success-dim, #4CAF50);
    border-radius: 8px;
}

.lamnia-dark-theme .voucher-code-box {
    background: #1a1a1a;
    border-color: var(--success-dim, #4CAF50);
}

.voucher-code {
    font-size: 2em;
    font-weight: bold;
    letter-spacing: 2px;
    font-family: monospace;
}

.btn-copy-voucher {
    background: var(--success-dim, #4CAF50);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.btn-copy-voucher:hover {
    opacity: 0.8;
}

.voucher-info {
    font-size: 1.1em;
    color: var(--text-muted, #666);
}

.awards-login-required,
.awards-not-active {
    text-align: center;
    padding: 40px;
    background: var(--card-bg, #f5f5f5);
    border-radius: 8px;
    margin: 40px 0;
}

.button-primary {
    display: inline-block;
    padding: 12px 30px;
    background: var(--success-dim, #4CAF50);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 1.1em;
    margin-top: 15px;
}

.button-primary:hover {
    opacity: 0.9;
}

.competition-rules-link-wrapper {
  padding: 20px 0;
  text-align: center;
}

.competition-rules-link {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--success, #007bff);
  text-decoration: underline;

  cursor: pointer;
  padding: 10px 20px;

  transition: color 0.2s;
}

/* Fullscreen overlay */
#competition-rules-overlay {
    position: fixed;
    opacity: 0;
    transition: opacity 300ms ease;
    pointer-events: none;
    display: flex; 
    align-items: center;
    justify-content: center;
    inset: 0;
    padding: 40px;
    background: rgba(0, 0, 0, 0.6);
    z-index: 15;
    margin-top: 90px;
}

/* When visible (fade-in) */
#competition-rules-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Modal content box */
#competition-rules-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--card-bg, #fff);
    color: var(--text, #000);
    width: 100%;
    max-width: 650px;
    max-height: 80vh;
    margin: 80px auto;
    padding: 20px 30px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transform: scale(0.95);
    transition: transform 200ms ease;
}

#competition-rules-overlay.visible #competition-rules-content {
    transform: scale(1);
}


#competition-rules-text {
  padding: 30px;
  text-align: left;
  overflow-y: auto;
  white-space: pre-wrap;
}

#competition-rules-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--background-lighter, #f2f2f2);
  padding: 12px 16px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border, #ddd);
  border-radius: 6px 6px 0 0;
}

#competition-rules-header h2 {
  margin: 0;
  font-size: 20px;
  flex: 1;
  text-align: center;
  color: var(--text, #000);
}

#rules-close-icon {
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  color: var(--text, #444);
  padding: 4px 8px;
  flex-shrink: 0;
}

#rules-close-icon:hover {
  opacity: 0.7;
}

/* Footer button */
#rules-close-button {
  margin-top: 10px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  background: var(--background-lighter, #f2f2f2);
  color: var(--text, #000);
  border: 1px solid var(--border, #ccc);
}

#rules-close-button:hover {
  opacity: 0.8;
}

/* Awards Approval UI */
#awards-approval-row {
    margin-top: 10px;
    padding: 10px;
    background-color: var(--background-lighter, #f5f5f5);
    color: var(--text, #000);
    border: 1px solid var(--border, #ddd);
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.awards-approval-checkbox-area {
    display: flex;
    align-items: center;
    gap: 5px;
}

.awards-approval-checkbox-area input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}

.awards-approval-checkbox-area label {
    cursor: pointer;
    user-select: none;
    color: var(--text, #000);
    margin: 0;
}

.awards-approval-button-area {
    margin-left: auto;
}

#awards-confirm-button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background: var(--background-lighter, #e0e0e0);
    color: var(--text, #000);
    border: 1px solid var(--border, #ccc);
}

#awards-confirm-button.awards-confirm-inactive {
    opacity: 0.5;
    cursor: not-allowed;
}

#awards-confirm-button.awards-confirm-active {
    opacity: 1;
    cursor: pointer;
    background: var(--success, #78d501);
    color: #fff;
    font-weight: 600;
    border-color: var(--success, #78d501);
}

.lamnia-dark-theme #awards-confirm-button.awards-confirm-active {
    color: #000;
}

@media (max-width: 1024px) {
    #competition-rules-overlay {
        margin-top: 57px;
    }
    #competition-rules-header {
        padding: 5px 10px;
        margin-bottom: 10px;
    }
    #competition-rules-header h3 {
        margin-top: 7px; 
        margin-bottom: 7px;
    }
}


@media (max-width: 768px) {
    .awards-voting-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .voting-slot {
        padding: 0;
        background: transparent;
        box-shadow: none;
    }
    
    .voting-slot h2 {
        background: var(--card-bg, #f5f5f5);
        margin: 0;
        padding: 15px 20px;
        cursor: pointer;
        user-select: none;
        border-radius: 8px;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        transition: background 0.3s ease;
        scroll-margin-top: 20px;
    }
    
    .lamnia-dark-theme .voting-slot h2 {
        background: #2a2a2a;
    }
    
    .voting-slot h2:hover {
        background: var(--hover-bg, #e8e8e8);
    }
    
    .lamnia-dark-theme .voting-slot h2:hover {
        background: #3a3a3a;
    }
    
    .voting-slot h2::after {
        content: '\f078';
        font-family: FontAwesome;
        font-size: 0.8em;
        transition: transform 0.3s ease;
        margin-left: 10px;
    }
    
    .voting-slot.active h2::after {
        transform: rotate(180deg);
    }
    
    .voting-slot-content {
        max-height: 0;
        overflow: visible;
        transition: max-height 0.4s ease;
        background: var(--card-bg, #f5f5f5);
        border-radius: 0 0 8px 8px;
        margin-top: -8px;
    }
    
    .lamnia-dark-theme .voting-slot-content {
        background: #2a2a2a;
    }
    
    .voting-slot.active .voting-slot-content {
        max-height: 600px;
        padding: 0 20px 20px 20px;
    }
    
    .voting-slot-content-inner {
        padding-top: 15px;
    }
    
    .voting-slot:not(.active) .voting-slot-content-inner {
        opacity: 0;
        pointer-events: none;
    }
    
    .voting-slot.active .voting-slot-content-inner {
        opacity: 1;
        pointer-events: auto;
    }
    
    .voting-slot .product-search {
        position: relative;
        overflow: visible;
        z-index: 100;
    }
    
    .voting-slot .btn-vote,
    .voting-slot .vote-status {
        overflow: hidden;
    }
    
    .voting-slot .selected-product:not(.has-product) {
        display: none;
    }
    
    .awards-content h1 {
        font-size: 1.8em;
    }
    
    .voucher-code {
        font-size: 1.5em;
    }
    
    .voucher-code-box {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .btn-copy-voucher {
        width: 100%;
        justify-content: center;
    }
    
    .awards-content {
        padding: 0 15px;
    }
    
    /* Widen rules modal on mobile */
    #competition-rules-overlay {
        padding: 7px;
        margin-top: 52px;
    }
    
    #competition-rules-content {
        max-width: 98%;
        width: 98%;
        margin: 10px auto;
        padding: 10px;
        max-height: 90vh;
    }
    
    #competition-rules-text {
        padding: 10px;
    }
    
    #competition-rules-header h2 {
        font-size: 18px;
    }
}

/* ============================================
   Results View Styling
   ============================================ */

.awards-results-container {
    margin-top: 40px;
}

.awards-results-intro {
    max-width: 800px;
    margin: 0 auto 30px;
    text-align: center;
}

.awards-results-intro p {
    font-size: 1.1em;
    line-height: 1.6;
    white-space: pre-line;
}

.awards-results-selector {
    margin-bottom: 30px;
    text-align: center;
}

.awards-results-selector label {
    display: inline-block;
    margin-right: 10px;
    font-weight: bold;
    font-size: 1.1em;
}

.awards-results-selector select {
    padding: 10px 15px;
    font-size: 1em;
    border: 1px solid var(--border-dark, #ddd);
    border-radius: 4px;
    background: var(--card-bg, #fff);
    color: var(--text-primary, #000);
    cursor: pointer;
    min-width: 150px;
}

.lamnia-dark-theme .awards-results-selector select {
    background: #2a2a2a;
    border-color: #444;
    color: #fff;
}

.awards-results-selector select:focus {
    outline: none;
    border-color: var(--success-dim, #4CAF50);
}

.awards-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    transition: opacity 0.3s ease;
}

.awards-results-grid.loading {
    opacity: 0.5;
    pointer-events: none;
}

.awards-manual-block {
    grid-column: 1 / -1;
    border-radius: 8px;
    padding: 10px;
}

.awards-manual-horizontal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.awards-result-category {
    background: var(--card-bg, #f5f5f5);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.lamnia-dark-theme .awards-result-category {
    background: #2a2a2a;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.awards-result-category h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
    text-align: center;
    color: var(--success-dim, #4CAF50);
}

.lamnia-dark-theme .awards-result-category h2 {
    color: var(--success, #78d501);
}

.category-total-votes {
    text-align: center;
    font-size: 0.95em;
    margin-bottom: 20px;
    color: var(--text-secondary, #666);
}

.lamnia-dark-theme .category-total-votes {
    color: #999;
}

/* Section Subtitles - visual separation for different result groupings */
.awards-results-subtitle {
    font-size: 2rem;
    font-weight: 600;
    margin: 30px 0 16px 0;
    padding-top: 22px;
    padding-bottom: 1rem;
    border-top: 2px solid var(--border-dark, #ddd);
    color: var(--text-primary, #000);
    min-height: 4em;
    line-height: 1.2;
    text-align: center;
}

.lamnia-dark-theme .awards-results-subtitle {
    border-top-color: #444;
    color: #fff;
}

.awards-results-subtitle:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.awards-results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.awards-result-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--card-content, #fff);
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    min-height: 0;
}

.lamnia-dark-theme .awards-result-card {
    background: #1a1a1a;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.awards-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.lamnia-dark-theme .awards-result-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

/* Rank Badge */
.rank-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border-dark, #ddd);
    color: var(--text-primary, #000);
    font-weight: bold;
    font-size: 1.1em;
    flex-shrink: 0;
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
}

.lamnia-dark-theme .rank-badge {
    background: #3a3a3a;
    color: #fff;
}

.rank-badge.rank-winner {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.rank-badge.rank-second {
    background: linear-gradient(135deg, #E6E9EF 0%, #9AA3B2 100%);
    color: #111;
    box-shadow: 0 2px 8px rgba(154, 163, 178, 0.4);
}

.rank-badge.rank-third {
    background: linear-gradient(135deg, #D8A06D 0%, #9C5C36 100%);
    color: #111;
    box-shadow: 0 2px 8px rgba(156, 92, 54, 0.35);
}

.rank-badge.rank-top3 {
    font-size: 1.8em;
    width: 45px;
    height: 45px;
    left: -10px;
    top: -10px;
}

.rank-icon {
    display: block;
}

.rank-number {
    display: block;
}

/* Manual results: hide non-winner gray rank badges and keep text alignment equal */
.awards-result-card[data-rank="0"] .rank-badge {
    display: none;
}

.awards-result-card .result-product-info {
    padding: 0px 20px;
}

/* Product Link and Info */
.result-product-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    width: 100%;
    gap: 4px;
}

.result-product-link:hover {
    text-decoration: none;
}

.result-product-image {
    display: none;
}

.result-product-image img {
    display: none;
}

.result-product-info {
    width: 100%;
    text-align: center;
    padding-left: 50px;
}

.result-product-name {
    font-size: 0.95em;
    font-weight: bold;
    margin: 0;
    color: var(--text-primary, #000);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    min-height: calc(1.3em * 2);
}

.lamnia-dark-theme .result-product-name {
    color: #fff;
}

.result-product-link:hover .result-product-name {
    color: var(--success-dim, #4CAF50);
}

/* Vote Stats */
.result-votes {
    width: 100%;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-dark, #ddd);
}

.lamnia-dark-theme .result-votes {
    border-top-color: #444;
}

.vote-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.85em;
}

.vote-count {
    font-weight: bold;
    color: var(--text-primary, #000);
}

.lamnia-dark-theme .vote-count {
    color: #fff;
}

.vote-percentage {
    font-weight: bold;
    color: var(--success-dim, #4CAF50);
}

.vote-bar {
    width: 100%;
    height: 6px;
    background: var(--border-dark, #ddd);
    border-radius: 3px;
    overflow: hidden;
}

.lamnia-dark-theme .vote-bar {
    background: #3a3a3a;
}

.vote-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-dim, #4CAF50) 0%, #45a049 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary, #666);
    font-size: 1.1em;
}

.lamnia-dark-theme .no-results {
    color: #999;
}

/* Responsive Design for Results View */
@media (max-width: 768px) {
    .awards-results-container {
        margin-top: 30px;
    }
    
    .awards-results-grid {
        grid-template-columns: 1fr;
    }
    
    .awards-result-category {
        padding: 15px;
    }
    
    .awards-result-category h2 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
    
    .awards-results-subtitle {
        margin: 22px 0 12px 0;
        padding-top: 16px;
        font-size: 1.05em;
    }
    
    .awards-results-selector label {
        display: block;
        margin-bottom: 10px;
    }
    
    .result-product-info {
        padding-left: 0;
    }
}
