/* Wheel of Names Specific Styles */

/* Wheel-specific styles only */

.wheel-wrapper {
    position: relative;
    display: inline-block;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15)); /* Modern shadow */
    width: 280px;
    height: 280px;
}

#wheel-canvas {
    border-radius: 50%;
    width: 280px;
    height: 280px;
}

.wheel-pointer {
    position: absolute;
    top: -12px; /* Slightly smaller */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent; /* Smaller pointer */
    border-right: 12px solid transparent;
    border-top: 20px solid hsl(var(--destructive));
    z-index: 10;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.2)); /* Subtler shadow */
}

/* Spin Button */
.spin-button {
    /* Styles handled by .btn-primary .btn-large */
}

/* Result Container */
.result-container {
    margin: 2rem 0;
}

#wheel-result {
    font-size: 1.5rem;
    font-weight: 700;
    min-height: 2rem;
    margin: 1rem 0;
    transition: all 0.3s ease;
    color: hsl(var(--foreground));
}

#wheel-result.winner {
    color: hsl(var(--primary));
    text-shadow: 0 2px 4px hsl(var(--primary) / 0.3);
    animation: resultPop 0.6s ease;
}

/* Names Manager - specific overrides only */

.add-name-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid hsl(var(--border));
}

.add-name-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 1rem;
    text-align: left;
}

.add-name-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

#name-input {
    flex: 1;
    min-width: 200px;
    /* Styles handled by .input-field */
}

.add-name-button {
    white-space: nowrap;
    /* Styles handled by .btn-primary */
}

.add-multiple-button {
    width: 100%;
    /* Styles handled by .btn-secondary */
}

/* Names List Section */
.names-list-section {
    text-align: left;
}

.names-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.names-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin: 0;
}

.names-actions {
    display: flex;
    gap: 0.5rem;
}

.clear-all-button:hover {
    background: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
    border-color: hsl(var(--destructive));
}

.shuffle-button:hover {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

/* Both buttons use .btn-secondary .btn-small base styles */

.names-list {
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
    background: hsl(var(--muted) / 0.3);
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1rem;
}

.no-names {
    color: hsl(var(--muted-foreground));
    text-align: center;
    margin: 0;
    padding: 2rem 1rem;
    font-style: italic;
}

.name-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) * 0.8);
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.name-item:hover {
    background: hsl(var(--accent) / 0.5);
    transform: translateX(2px);
}

.name-item:last-child {
    margin-bottom: 0;
}

.name-text {
    font-weight: 500;
    color: hsl(var(--foreground));
    flex: 1;
    word-break: break-word;
}

.remove-name-btn {
    background: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 700;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.remove-name-btn:hover {
    background: hsl(var(--destructive) / 0.9);
    transform: scale(1.1);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) * 2);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { transform: scale(0.9) translateY(-10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid hsl(var(--border));
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: hsl(var(--muted-foreground));
    transition: color 0.2s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: hsl(var(--foreground));
}

.modal-body {
    padding: 2rem;
}

.modal-body p {
    margin-bottom: 1rem;
    color: hsl(var(--muted-foreground));
}

#multiple-names-input {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
}

#multiple-names-input:focus {
    outline: none;
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid hsl(var(--border));
}

.cancel-button {
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border: 1px solid hsl(var(--border));
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.cancel-button:hover {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.add-button {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.add-button:hover:not(:disabled) {
    background: hsl(var(--primary) / 0.9);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px hsl(var(--primary) / 0.2);
}

.add-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive wheel sizing */
@media (max-width: 1023px) {
    .wheel-wrapper {
        width: 260px;
        height: 260px;
    }
    
    #wheel-canvas {
        width: 260px;
        height: 260px;
    }
}

@media (max-width: 767px) {
    .wheel-wrapper {
        width: 220px;
        height: 220px;
    }
    
    #wheel-canvas {
        width: 220px;
        height: 220px;
    }
    
    .names-manager {
        padding: 1.5rem;
    }
}

@media (max-width: 374px) {
    .wheel-wrapper {
        width: 200px;
        height: 200px;
    }
    
    #wheel-canvas {
        width: 200px;
        height: 200px;
    }
}
    
    .add-name-form {
        flex-direction: column;
    }
    
    #name-input {
        min-width: auto;
    }
    
    .names-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .names-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .cancel-button,
    .add-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .names-manager {
        padding: 1rem;
    }
}

/* Animation for spinning */
.wheel-spinning {
    pointer-events: none;
}

.wheel-spinning #wheel-canvas {
    transition: transform 4s cubic-bezier(0.2, 0, 0.2, 1);
}

/* Winner highlight animation */
@keyframes resultPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Name item enter animation */
@keyframes nameItemEnter {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.name-item {
    animation: nameItemEnter 0.3s ease;
}