.mdq-sorteos-wrapper {
    --mdq-primary: #6366f1;
    --mdq-primary-dark: #4f46e5;
    --mdq-primary-light: #818cf8;
    --mdq-success: #10b981;
    --mdq-success-dark: #059669;
    --mdq-warning: #f59e0b;
    --mdq-warning-dark: #d97706;
    --mdq-danger: #ef4444;
    --mdq-danger-dark: #dc2626;
    --mdq-gold: #fbbf24;
    --mdq-silver: #94a3b8;
    --mdq-bronze: #b45309;
    --mdq-bg: #f8fafc;
    --mdq-card-bg: #ffffff;
    --mdq-text: #1e293b;
    --mdq-text-muted: #64748b;
    --mdq-border: #e2e8f0;
    --mdq-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --mdq-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --mdq-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --mdq-radius: 16px;
    --mdq-radius-sm: 10px;
    --mdq-radius-full: 9999px;

    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.mdq-sorteos-container {
    background: var(--mdq-card-bg);
    border-radius: var(--mdq-radius);
    box-shadow: var(--mdq-shadow-xl);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.mdq-sorteos-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--mdq-primary), var(--mdq-primary-light), var(--mdq-gold), var(--mdq-primary));
    background-size: 200% 100%;
    animation: mdq-gradient-shift 3s ease infinite;
}

@keyframes mdq-gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.mdq-sorteo-header {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.mdq-mode-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.25rem;
    background: var(--mdq-bg);
    border-radius: var(--mdq-radius-sm);
}

.mdq-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 2px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--mdq-text-muted);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.mdq-mode-btn:hover {
    color: var(--mdq-text);
    background: rgba(255, 255, 255, 0.5);
}

.mdq-mode-btn.active {
    background: var(--mdq-card-bg);
    border-color: var(--mdq-border);
    color: var(--mdq-primary);
    box-shadow: var(--mdq-shadow);
}

.mdq-mode-btn i {
    font-size: 1.125rem;
}

.mdq-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--mdq-text);
    margin: 0;
    background: linear-gradient(135deg, var(--mdq-primary), var(--mdq-primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mdq-sparks {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    pointer-events: none;
}

.mdq-sparks span {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--mdq-gold);
    border-radius: 50%;
    animation: mdq-sparkle 2s ease-in-out infinite;
}

.mdq-sparks span:nth-child(1) { top: 10%; left: 20%; animation-delay: 0s; }
.mdq-sparks span:nth-child(2) { top: 20%; right: 15%; animation-delay: 0.3s; }
.mdq-sparks span:nth-child(3) { bottom: 10%; left: 30%; animation-delay: 0.6s; }
.mdq-sparks span:nth-child(4) { bottom: 20%; right: 25%; animation-delay: 0.9s; }
.mdq-sparks span:nth-child(5) { top: 50%; left: 10%; animation-delay: 1.2s; }

@keyframes mdq-sparkle {
    0%, 100% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1); }
}

.mdq-input-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.mdq-input-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.mdq-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 2px solid var(--mdq-border);
    border-radius: var(--mdq-radius-sm);
    background: var(--mdq-card-bg);
    color: var(--mdq-text-muted);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mdq-tab-btn:hover {
    border-color: var(--mdq-primary-light);
    color: var(--mdq-primary);
}

.mdq-tab-btn.active {
    background: var(--mdq-primary);
    border-color: var(--mdq-primary);
    color: white;
}

.mdq-tab-btn i {
    font-size: 0.875rem;
}

.mdq-tab-content {
    display: none;
}

.mdq-tab-content.active {
    display: block;
}

.mdq-upload-zone {
    position: relative;
    border: 2px dashed var(--mdq-border);
    border-radius: var(--mdq-radius-sm);
    padding: 2rem 1rem;
    text-align: center;
    background: var(--mdq-bg);
    transition: all 0.3s ease;
    cursor: pointer;
}

.mdq-upload-zone.dragover {
    border-color: var(--mdq-primary);
    background: rgba(99, 102, 241, 0.05);
}

.mdq-upload-zone.has-file {
    border-style: solid;
    border-color: var(--mdq-success);
    background: rgba(16, 185, 129, 0.05);
}

.mdq-file-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
}

.mdq-upload-icon {
    font-size: 2.5rem;
    color: var(--mdq-primary-light);
    margin-bottom: 0.75rem;
}

.mdq-upload-zone.dragover .mdq-upload-icon {
    color: var(--mdq-primary);
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.mdq-upload-text {
    font-size: 0.9375rem;
    color: var(--mdq-text-muted);
    margin: 0 0 0.75rem 0;
}

.mdq-upload-btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: var(--mdq-primary);
    color: white;
    border-radius: var(--mdq-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mdq-upload-btn:hover {
    background: var(--mdq-primary-dark);
}

.mdq-upload-hint {
    font-size: 0.75rem;
    color: var(--mdq-text-muted);
    margin: 0.75rem 0 0 0;
}

.mdq-upload-file {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--mdq-card-bg);
    border-radius: var(--mdq-radius-sm);
    box-shadow: var(--mdq-shadow);
}

.mdq-upload-file i.fa-file-check {
    color: var(--mdq-success);
    font-size: 1.25rem;
}

.mdq-upload-filename {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mdq-text);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mdq-upload-remove {
    background: none;
    border: none;
    color: var(--mdq-danger);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.mdq-upload-remove:hover {
    transform: scale(1.2);
}

.mdq-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mdq-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--mdq-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mdq-label i {
    color: var(--mdq-primary);
}

.mdq-textarea {
    width: 100%;
    min-height: 140px;
    padding: 0.875rem 1rem;
    border: 2px solid var(--mdq-border);
    border-radius: var(--mdq-radius-sm);
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--mdq-text);
    background: var(--mdq-bg);
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.mdq-textarea:focus {
    outline: none;
    border-color: var(--mdq-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.mdq-textarea::placeholder {
    color: var(--mdq-text-muted);
}

.mdq-participant-count {
    text-align: right;
}

.mdq-count-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--mdq-bg);
    border: 1px solid var(--mdq-border);
    border-radius: var(--mdq-radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--mdq-text-muted);
    transition: all 0.2s ease;
}

.mdq-count-badge.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--mdq-primary-light);
    color: var(--mdq-primary);
}

.mdq-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem 1rem;
    background: var(--mdq-bg);
    border-radius: var(--mdq-radius-sm);
}

.mdq-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.mdq-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mdq-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--mdq-border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.mdq-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.mdq-toggle input:checked + .mdq-toggle-slider {
    background: var(--mdq-primary);
}

.mdq-toggle input:checked + .mdq-toggle-slider::before {
    transform: translateX(20px);
}

.mdq-toggle-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mdq-text);
}

.mdq-toggle-hint {
    font-size: 0.75rem;
    color: var(--mdq-text-muted);
    margin: 0.25rem 0 0 0;
}

.mdq-premio-card {
    background: var(--mdq-bg);
    border: 1px solid var(--mdq-border);
    border-radius: var(--mdq-radius-sm);
    padding: 1rem 1.25rem;
    margin: 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: mdq-winner-appear 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.mdq-premio-card:nth-child(1) { animation-delay: 0.1s; }
.mdq-premio-card:nth-child(2) { animation-delay: 0.2s; }
.mdq-premio-card:nth-child(3) { animation-delay: 0.3s; }
.mdq-premio-card:nth-child(4) { animation-delay: 0.4s; }
.mdq-premio-card:nth-child(5) { animation-delay: 0.5s; }
.mdq-premio-card:nth-child(n+6) { animation-delay: 0.6s; }

.mdq-premio-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f472b6, #ec4899);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.mdq-premio-details {
    flex-grow: 1;
    text-align: left;
}

.mdq-premio-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--mdq-text-muted);
    margin-bottom: 0.25rem;
}

.mdq-premio-winner-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--mdq-text);
}

.mdq-premio-won-badge {
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--mdq-gold), #f59e0b);
    color: white;
    border-radius: var(--mdq-radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.mdq-prize-summary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--mdq-radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.mdq-summary-item {
    text-align: center;
}

.mdq-summary-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mdq-primary);
}

.mdq-summary-label {
    font-size: 0.75rem;
    color: var(--mdq-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mdq-winners-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
}

.mdq-btn-qty {
    width: 36px;
    height: 36px;
    border: 2px solid var(--mdq-border);
    border-radius: var(--mdq-radius-sm);
    background: var(--mdq-card-bg);
    color: var(--mdq-text);
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mdq-btn-qty:hover {
    border-color: var(--mdq-primary);
    color: var(--mdq-primary);
    background: rgba(99, 102, 241, 0.05);
}

.mdq-input-number {
    width: 60px;
    height: 36px;
    text-align: center;
    border: 2px solid var(--mdq-border);
    border-radius: var(--mdq-radius-sm);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--mdq-text);
    background: var(--mdq-bg);
    -moz-appearance: textfield;
}

.mdq-input-number::-webkit-outer-spin-button,
.mdq-input-number::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.mdq-input-number:focus {
    outline: none;
    border-color: var(--mdq-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.mdq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--mdq-radius-sm);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.mdq-btn:active {
    transform: scale(0.97);
}

.mdq-btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--mdq-primary), var(--mdq-primary-dark));
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.mdq-btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

.mdq-btn-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: mdq-shimmer 3s infinite;
}

@keyframes mdq-shimmer {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

.mdq-btn-success {
    background: linear-gradient(135deg, var(--mdq-success), var(--mdq-success-dark));
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.mdq-btn-success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    transform: translateY(-2px);
}

.mdq-btn-warning {
    background: linear-gradient(135deg, var(--mdq-warning), var(--mdq-warning-dark));
    color: white;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.mdq-btn-warning:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
    transform: translateY(-2px);
}

.mdq-btn-danger {
    background: linear-gradient(135deg, var(--mdq-danger), var(--mdq-danger-dark));
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.mdq-btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
}

.mdq-progress-container {
    width: 100%;
    height: 8px;
    background: var(--mdq-bg);
    border-radius: var(--mdq-radius-full);
    margin: 1.5rem 0;
    overflow: hidden;
}

.mdq-progress-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--mdq-primary), var(--mdq-primary-light));
    border-radius: var(--mdq-radius-full);
    transition: width 1s ease;
}

.mdq-cuenta-regresiva {
    font-size: 5rem;
    font-weight: 700;
    text-align: center;
    color: var(--mdq-primary);
    margin: 1rem 0;
    animation: mdq-pulse 1s ease-in-out infinite;
}

@keyframes mdq-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.mdq-ganadores {
    text-align: center;
    margin: 1.5rem 0;
}

.mdq-winners-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--mdq-text-muted);
    margin: 0 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.mdq-winner-card {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0.05));
    border: 2px solid var(--mdq-gold);
    border-radius: var(--mdq-radius-sm);
    padding: 1rem 1.25rem;
    margin: 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: mdq-winner-appear 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.mdq-winner-card:nth-child(1) { animation-delay: 0.1s; }
.mdq-winner-card:nth-child(2) { animation-delay: 0.3s; }
.mdq-winner-card:nth-child(3) { animation-delay: 0.5s; }
.mdq-winner-card:nth-child(4) { animation-delay: 0.7s; }
.mdq-winner-card:nth-child(5) { animation-delay: 0.9s; }
.mdq-winner-card:nth-child(n+6) { animation-delay: 1.1s; }

@keyframes mdq-winner-appear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mdq-winner-position {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.mdq-winner-position.first {
    background: linear-gradient(135deg, var(--mdq-gold), #f59e0b);
    color: white;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

.mdq-winner-position.second {
    background: linear-gradient(135deg, var(--mdq-silver), #64748b);
    color: white;
    box-shadow: 0 4px 12px rgba(148, 163, 184, 0.4);
}

.mdq-winner-position.third {
    background: linear-gradient(135deg, var(--mdq-bronze), #92400e);
    color: white;
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.4);
}

.mdq-winner-position.other {
    background: var(--mdq-bg);
    color: var(--mdq-text-muted);
    border: 2px solid var(--mdq-border);
}

.mdq-winner-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--mdq-text);
    flex-grow: 1;
    text-align: left;
}

.mdq-wwinner-icon {
    font-size: 1.5rem;
}

.mdq-success-message {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    color: var(--mdq-success);
    margin: 1rem 0;
    animation: mdq-fade-in 0.5s ease-out;
}

@keyframes mdq-fade-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.mdq-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--mdq-border);
}

.mdq-actions .mdq-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

@media (max-width: 480px) {
    .mdq-sorteos-wrapper {
        margin: 1rem auto;
    }

    .mdq-sorteos-container {
        padding: 1.25rem;
    }

    .mdq-title {
        font-size: 1.5rem;
    }

    .mdq-cuenta-regresiva {
        font-size: 4rem;
    }

    .mdq-actions {
        flex-direction: column;
    }

    .mdq-actions .mdq-btn {
        width: 100%;
    }

    .mdq-mode-btn span {
        font-size: 0.8125rem;
    }

    .mdq-mode-btn {
        gap: 0.35rem;
        padding: 0.625rem 0.75rem;
    }

    .mdq-premio-card {
        flex-direction: column;
        text-align: center;
    }

    .mdq-premio-details {
        text-align: center;
    }

    .mdq-prize-summary {
        gap: 1rem;
    }
}
