
#pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 35px solid #2563eb;
    z-index: 10;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

html.dark #pointer {
    border-top-color: #60a5fa;
    filter: drop-shadow(0 4px 6px rgba(96, 165, 250, 0.4));
}

#pointer::after {
    content: '';
    position: absolute;
    top: -35px;
    left: -10px;
    width: 20px;
    height: 20px;
    background: #2563eb;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.6);
}

html.dark #pointer::after {
    background: #60a5fa;
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.8);
}

#canvas-container {
    position: relative;
    width: 90vw;
    height: 90vw;
    max-width: 550px;
    max-height: 550px;
    margin: 0 auto;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease;
}

#canvas-container:hover {
    transform: scale(1.02);
}

#canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    transition: all 0.3s ease;
}

#wheel-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    z-index: -1;
}

#wheel-center-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 20%;
    max-height: 20%;
    border-radius: 50%;
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.8);
}

html.dark #wheel-center-image {
    border-color: rgba(31, 41, 55, 0.8);
}

.item-preview img {
    max-width: 48px;
    max-height: 48px;
    margin-left: 10px;
    vertical-align: middle;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #e5e7eb;
    transition: transform 0.2s ease;
}

html.dark .item-preview img {
    border-color: #374151;
}

.item-preview img:hover {
    transform: scale(1.1);
}

#celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, rgba(139, 92, 246, 0.3) 50%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

#celebration.active {
    opacity: 1;
    animation: celebrationPulse 1s ease-in-out;
}

@keyframes celebrationPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

#customiseModal .modal-content-container,
#winnerModal .modal-content-container {
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.advanced-options {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid #e5e7eb;
    animation: slideDown 0.3s ease-out;
}

html.dark .advanced-options {
    border-top-color: #374151;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.advanced-options label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.advanced-options input[type="number"],
.advanced-options input[type="color"],
.advanced-options input[type="file"] {
    width: 100%;
    font-size: 0.875rem;
    padding: 6px 10px;
}

.advanced-options .adv-img-preview img {
    max-width: 24px;
    max-height: 24px;
    margin-left: 6px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
}

html.dark .advanced-options .adv-img-preview img {
    border-color: #4b5563;
}

.tab-button {
    position: relative;
    transition: all 0.3s ease;
}

.tab-button.active {
    border-color: #2563eb;
    color: #2563eb;
    font-weight: 600;
}

html.dark .tab-button.active {
    border-color: #60a5fa;
    color: #60a5fa;
}

.tab-button.active::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #2563eb, #c026d3);
    border-radius: 2px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.config-img-preview {
    max-width: 80px;
    max-height: 80px;
    margin-top: 8px;
    display: inline-block;
    vertical-align: middle;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    object-fit: cover;
    transition: transform 0.2s ease;
}

html.dark .config-img-preview {
    border-color: #4b5563;
}

.config-img-preview:hover {
    transform: scale(1.05);
}

.config-img-filename {
    font-size: 0.75rem;
    color: #6b7280;
    margin-left: 10px;
    display: inline-block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

html.dark .config-img-filename {
    color: #9ca3af;
}

#exitFullScreenBtn {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#exitFullScreenBtn:hover {
    transform: scale(1.1) rotate(90deg);
}

#languageSwitcher ul {
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    animation: dropdownSlide 0.2s ease-out;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#faqSection dt button svg,
#faqSection dt button i {
    transition: transform 0.3s ease-in-out;
}

#faqSection dt button[aria-expanded="true"] svg,
#faqSection dt button[aria-expanded="true"] i {
    transform: rotate(180deg);
}

#faqSection dd {
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.4s ease-out, padding 0.4s ease-out;
    max-height: 0;
    opacity: 0;
    padding: 0;
}

#faqSection dd.open {
    max-height: 800px;
    opacity: 1;
    padding-top: 0.5rem;
}

#faqSection dt {
    font-weight: 600;
}

#faqSection dt button {
    transition: all 0.2s ease;
}

#faqSection dt button:hover {
    padding-left: 0.5rem;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="password"],
textarea,
select {
    border: 2px solid #d1d5db;
    background-color: #ffffff;
    color: #111827;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    padding: 0.5rem 0.75rem;
}

html.dark input[type="text"],
html.dark input[type="number"],
html.dark input[type="email"],
html.dark input[type="tel"],
html.dark input[type="password"],
html.dark textarea,
html.dark select {
    border-color: #4b5563;
    background-color: #374151;
    color: #f9fafb;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

html.dark input[type="text"]:focus,
html.dark input[type="number"]:focus,
html.dark input[type="email"]:focus,
html.dark input[type="tel"]:focus,
html.dark input[type="password"]:focus,
html.dark textarea:focus,
html.dark select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

input[type="color"] {
    height: 2.75rem;
    width: 100%;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    padding: 0.25rem;
    cursor: pointer;
    background-color: #ffffff;
    transition: all 0.2s;
}

html.dark input[type="color"] {
    border-color: #4b5563;
    background-color: #374151;
}

input[type="color"]:hover {
    border-color: #3b82f6;
}

html.dark input[type="color"]:hover {
    border-color: #60a5fa;
}

input[type="checkbox"] {
    height: 1.25rem;
    width: 1.25rem;
    accent-color: #2563eb;
    border: 2px solid #d1d5db;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    background-color: #f3f4f6;
}

html.dark input[type="checkbox"] {
    accent-color: #3b82f6;
    border-color: #4b5563;
    background-color: #374151;
}

input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

html.dark input[type="checkbox"]:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input[type="range"] {
    width: 100%;
    height: 0.5rem;
    background: linear-gradient(to right, #e5e7eb, #d1d5db);
    border-radius: 0.5rem;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s;
}

html.dark input[type="range"] {
    background: linear-gradient(to right, #4b5563, #374151);
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
    transition: all 0.2s;
}

html.dark input[type="range"]::-webkit-slider-thumb {
    background: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #1d4ed8;
    transform: scale(1.1);
}

html.dark input[type="range"]::-webkit-slider-thumb:hover {
    background: #2563eb;
}

input[type="range"]::-moz-range-thumb {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
    transition: all 0.2s;
}

html.dark input[type="range"]::-moz-range-thumb {
    background: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

input[type="file"] {
    display: block;
    width: 100%;
    font-size: 0.875rem;
    color: #6b7280;
    cursor: pointer;
}

html.dark input[type="file"] {
    color: #9ca3af;
}

input[type="file"]::file-selector-button {
    margin-right: 1rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    border: 0;
    font-size: 0.875rem;
    font-weight: 600;
    background-color: #eff6ff;
    color: #1d4ed8;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

html.dark input[type="file"]::file-selector-button {
    background-color: rgba(37, 99, 235, 0.2);
    color: #93c5fd;
}

input[type="file"]::file-selector-button:hover {
    background-color: #dbeafe;
}

html.dark input[type="file"]::file-selector-button:hover {
    background-color: rgba(37, 99, 235, 0.3);
}

::placeholder {
    color: #9ca3af;
}

html.dark ::placeholder {
    color: #6b7280;
}

#winnerHistoryList li {
    padding: 10px 14px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 10px;
    border: 1px solid #d1d5db;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#winnerHistoryList li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(180deg, #2563eb, #c026d3);
    border-radius: 10px 0 0 10px;
}

html.dark #winnerHistoryList li {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border-color: #4b5563;
}

html.dark #winnerHistoryList li::before {
    background: linear-gradient(180deg, #60a5fa, #e879f9);
}

#winnerHistoryList li:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

html.dark #winnerHistoryList li:hover {
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
}

#history-section {
    max-height: calc(100vh - 200px);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

html.dark ::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #2563eb, #1d4ed8);
    border-radius: 10px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #1d4ed8, #1e40af);
}

html.dark ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #60a5fa, #3b82f6);
}

html.dark ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
}

@media (max-width: 640px) {
    #canvas-container {
        max-width: 350px;
        max-height: 350px;
    }
    
    #pointer {
        top: -12px;
        border-left: 15px solid transparent;
        border-right: 15px solid transparent;
        border-top: 28px solid #2563eb;
    }
    
    html.dark #pointer {
        border-top-color: #60a5fa;
    }
}

* {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}
