/* Wheel Spinner Tool Styles */

/* Main Container */
.wheel-main-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Wheel Container */
.wheel-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 30px 0;
}

.wheel-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
}

.wheel-canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

/* Spinning Animation */
.wheel-canvas-container.spinning {
    animation: none;
}

/* Arrow Pointer - Simple design with beautiful colors */
.wheel-arrow {
    position: absolute;
    top: 50%;
    right: -20px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 30px solid transparent;
    border-bottom: 30px solid transparent;
    border-right: 50px solid #667eea;
    z-index: 10;
    filter: drop-shadow(-4px 0 10px rgba(102, 126, 234, 0.6));
    transition: all 0.3s ease;
}

.wheel-arrow::before {
    content: '';
    position: absolute;
    top: -28px;
    left: 2px;
    width: 0;
    height: 0;
    border-top: 28px solid transparent;
    border-bottom: 28px solid transparent;
    border-right: 45px solid #764ba2;
    z-index: -1;
}

.wheel-arrow::after {
    content: '';
    position: absolute;
    top: -26px;
    left: 4px;
    width: 0;
    height: 0;
    border-top: 26px solid transparent;
    border-bottom: 26px solid transparent;
    border-right: 40px solid #9b59b6;
    z-index: -2;
}

/* Arrow hover effect */
.wheel-container:hover .wheel-arrow {
    transform: translateY(-50%) scale(1.05);
    filter: drop-shadow(-6px 0 15px rgba(102, 126, 234, 0.8));
}

/* Center Button */
.wheel-center-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(145deg, #667eea 0%, #764ba2 100%);
    border: 5px solid white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    z-index: 5;
}

.wheel-center-btn:hover:not(:disabled) {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.wheel-center-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #95a5a6;
}

/* Items Management */
.items-manager {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e9ecef;
}

[data-bs-theme="dark"] .items-manager {
    background: #2d3239;
    border-color: #495057;
}

.items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.items-count {
    font-size: 14px;
    color: #6c757d;
    font-weight: 600;
}

.items-count .count-number {
    color: #667eea;
    font-size: 18px;
    font-weight: 700;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.item-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 12px 15px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
}

[data-bs-theme="dark"] .item-entry {
    background: #343a40;
    border-color: #495057;
}

.item-entry:hover {
    border-color: #667eea;
    transform: translateX(5px);
}

.item-color {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    flex-shrink: 0;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.item-text {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #2c3e50;
}

[data-bs-theme="dark"] .item-text {
    color: #e9ecef;
}

.item-actions {
    display: flex;
    gap: 5px;
}

.item-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #f1f3f5;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

[data-bs-theme="dark"] .item-btn {
    background: #495057;
}

.item-btn:hover {
    background: #e9ecef;
    transform: scale(1.1);
}

[data-bs-theme="dark"] .item-btn:hover {
    background: #5a6268;
}

.item-btn.delete-btn:hover {
    background: #ffe3e3;
    color: #ff4757;
}

[data-bs-theme="dark"] .item-btn.delete-btn:hover {
    background: #5a2a2a;
    color: #ff6b6b;
}

/* Add Item Form */
.add-item-form {
    display: flex;
    gap: 10px;
}

.add-item-form input {
    flex: 1;
}

/* Bulk Add */
.bulk-add-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px dashed #dee2e6;
}

[data-bs-theme="dark"] .bulk-add-section {
    border-top-color: #495057;
}

.bulk-add-textarea {
    min-height: 120px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Settings Panel */
.settings-panel {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    border: 2px solid #e9ecef;
}

[data-bs-theme="dark"] .settings-panel {
    background: #2d3239;
    border-color: #495057;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

[data-bs-theme="dark"] .setting-item {
    border-bottom-color: #495057;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-label {
    font-weight: 600;
    font-size: 14px;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e9ecef;
    text-align: center;
}

[data-bs-theme="dark"] .stat-card {
    background: #343a40;
    border-color: #495057;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 13px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* History Table */
.history-table {
    margin-top: 20px;
}

.history-table table {
    width: 100%;
}

.winner-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
}

/* Result Announcement */
.result-announcement {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 50px 80px;
    border-radius: 30px;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    text-align: center;
    border: 5px solid white;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}

.result-announcement.show {
    animation: showResult 3s ease-in-out forwards;
}

@keyframes showResult {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3) rotate(-15deg);
    }
    15% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.15) rotate(8deg);
    }
    30% {
        transform: translate(-50%, -50%) scale(0.95) rotate(-4deg);
    }
    45% {
        transform: translate(-50%, -50%) scale(1.05) rotate(2deg);
    }
    60%, 85% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.7) rotate(0deg);
    }
}

.result-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.9;
}

.result-winner {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 10px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.result-emoji {
    font-size: 60px;
    margin-top: 10px;
}

/* Effects Canvas */
#confettiCanvas, #fireworksCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: transparent; /* Ensure transparent background */
}

#fireworksCanvas {
    z-index: 10000; /* Fireworks on top of confetti */
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.empty-state-text {
    font-size: 14px;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .wheel-container {
        max-width: 350px;
    }
    
    .wheel-center-btn {
        width: 60px;
        height: 60px;
        font-size: 12px;
    }
    
    .wheel-arrow {
        right: -16px;
        border-top-width: 24px;
        border-bottom-width: 24px;
        border-right-width: 40px;
    }
    
    .wheel-arrow::before {
        top: -22px;
        left: 2px;
        border-top-width: 22px;
        border-bottom-width: 22px;
        border-right-width: 35px;
    }
    
    .wheel-arrow::after {
        top: -20px;
        left: 4px;
        border-top-width: 20px;
        border-bottom-width: 20px;
        border-right-width: 32px;
    }
    
    .result-winner {
        font-size: 36px;
    }
    
    .result-announcement {
        padding: 35px 50px;
    }
    
    .items-manager {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .wheel-container {
        max-width: 300px;
    }
    
    .wheel-arrow {
        right: -14px;
        border-top-width: 20px;
        border-bottom-width: 20px;
        border-right-width: 35px;
    }
    
    .wheel-arrow::before {
        top: -18px;
        left: 2px;
        border-top-width: 18px;
        border-bottom-width: 18px;
        border-right-width: 30px;
    }
    
    .wheel-arrow::after {
        top: -16px;
        left: 4px;
        border-top-width: 16px;
        border-bottom-width: 16px;
        border-right-width: 28px;
    }
    
    .result-winner {
        font-size: 28px;
    }
    
    .result-announcement {
        padding: 25px 35px;
    }
}

/* Fix for Clear History button icon color */
.btn-outline-danger .fsvg {
    filter: brightness(0) saturate(100%) invert(27%) sepia(93%) saturate(3341%) hue-rotate(346deg) brightness(95%) contrast(97%);
}

.btn-outline-danger:hover .fsvg,
.btn-outline-danger:active .fsvg {
    filter: brightness(0) saturate(100%) invert(100%);
}