#rp-container {
    max-width: 850px;
    margin: 30px auto 40px;
    padding: 15px 25px 25px;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    grid-template-areas:
        "title title"
        "inputs results";
    gap: 20px 30px;
}

#rp-container,
#rp-button-group {
    scroll-margin-top: 20px;
}

#rp-container h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    grid-area: title;
}

#rp-mode {
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.rp-inputs-area {
    grid-area: inputs;
}

#rp-mode label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    font-size: 16px;
}

/* Increase radio button size */
#rp-mode label input[type="radio"] {
    width: 16px;
    /* Adjust as needed */
    height: 16px;
    /* Adjust as needed */
    margin-right: 5px;
    /* Keep some spacing */
    vertical-align: middle;
    /* Align radio button with text */
}


.rp-inputs-area label:not(#rp-mode label),
#rp-team-count-container label {
    display: block;
    margin: 10px 0 5px;
    font-weight: 500;
    font-size: 16px;
}

#rp-items,
#rp-range-wrapper input,
#rp-separator {
    width: 100%;
    font-size: 16px;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    resize: vertical;
}

#rp-items {
    min-height: 120px;
}

#rp-range-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

#rp-separator,
#rp-separator {
    margin-bottom: 15px;
    /* Custom arrow for select dropdown */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 8L10 12L14 8' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    background-size: 20px;
    padding-right: 40px;
    cursor: pointer;
}

#rp-duplicate-handling {
    width: 60%;
    font-size: 16px;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 8L10 12L14 8' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    background-size: 20px;
    padding-right: 30px;
}

#rp-count,
#rp-team-count,
#rp-countdown-time {
    width: 100%;
    padding: 7px 10px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    /* Ensures padding doesn't add to the width */
}

#rp-count,
#rp-team-count {
    margin-bottom: 5px;
}

/* Hides spinners from number inputs */
.rp-inputs-area input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.rp-inputs-area input[type="number"]::-webkit-inner-spin-button,
.rp-inputs-area input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rp-inline-fields {
    display: flex;
    gap: 20px;
}

.rp-inline-fields>div {
    flex: 1;
}

/* Special class to make a field in rp-inline-fields take up 50% width */
.rp-inline-fields .rp-field-50 {
    flex: 0 0 50%;
}

#rp-button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
    scroll-margin-top: 20px;
}

#rp-pick-btn,
#rp-clear-btn {
    padding: 8px 13px;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s, transform 0.15s ease;
}

#rp-pick-btn {
    background-color: #208537;
}

#rp-pick-btn:hover,
#rp-pick-btn:active,
#rp-pick-btn:focus {
    background-color: #208537;
    color: white;
}

#rp-clear-btn {
    background-color: #6c757d;
    color: white;
}

#rp-shuffle-list-btn {
    padding: 9px 13px;
    border: none;
    border-radius: 8px;
    background-color: #ffc107;
    color: #212529;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.15s ease;
}

#rp-clear-btn:hover,
#rp-clear-btn:active,
#rp-clear-btn:focus {
    background-color: #6c757d;
    color: white;
}

#rp-shuffle-list-btn:hover,
#rp-shuffle-list-btn:active,
#rp-shuffle-list-btn:focus {
    background-color: #ffc107;
    color: #212529;
}

#rp-pick-btn:active,
#rp-clear-btn:active,
#rp-shuffle-list-btn:active {
    transform: scale(0.97);
    transition-duration: 0.05s;
}

#rp-options-toggle:hover {
    background-color: transparent;
}

.rp-results-area {
    font-size: 17px;
    font-weight: 500;
    color: #333;
    min-height: 24px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    /* Center content horizontally */
    text-align: center;
    grid-area: results;
    min-height: 200px;
    max-height: 350px;
    overflow-y: auto;
}

/* Center content only when countdown is active */
.rp-results-area.is-counting {
    justify-content: center;
    align-items: center;
}

#rp-result-content {
    width: 100%;
}

.rp-placeholder {
    color: #5a5555;
    font-weight: normal;
    font-style: italic;
}

#rp-result-content .selected-header {
    background-color: #f0f0f0;
    padding: 5px;
    border-radius: 5px;
    display: block;
    margin-bottom: 5px;
    text-align: center;
}

#rp-result-content ol {
    text-align: left;
    padding-left: 30px;
}

/* Countdown animation styles */
#rp-countdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 120px;
    height: 120px;
    margin: 20px auto;
}

#rp-countdown .rp-countdown-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(#4f46e5, #8b5cf6, #ec4899, #f59e0b, #10b981, #4f46e5);
    animation: spin 1s linear infinite, pulse 2s infinite;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

/* Cover the center of the spinning border to create a ring effect */
#rp-countdown .rp-countdown-circle::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    background: #f9f9f9;
    border-radius: 50%;
}

#rp-countdown #rp-countdown-number {
    position: relative;
    font-size: 48px;
    font-weight: 500;
    color: #333;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(79, 70, 229, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
}

/* Utility Classes */
.rp-hidden {
    display: none !important;
}

#rp-warnings {
    font-size: 14px;
    color: #dc3545;
    margin-top: 5px;
}

#rp-advanced-options-container {
    margin-top: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 6px 13px;
}

#rp-options-toggle {
    background: none;
    border: none;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    font-size: 17px;
    padding: 0;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
    position: relative;
    padding: 0;
    transition: transform 0.15s ease;
}

#rp-options-toggle::after {
    content: '';
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9L12 15L18 9' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

#rp-options-toggle.expanded {
    background-color: #f8f9fa;
    margin: 0;
    padding: 10px 15px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

#rp-options-toggle:active {
    transform: scale(0.99);
    transition-duration: 0.05s;
}

#rp-options-toggle.expanded:hover {
    background-color: #f8f9fa;
    color: #333;
}

#rp-options-toggle.expanded::after {
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 15L12 9L18 15' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

#rp-options-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease-in-out, padding-top 0.4s ease-in-out;
    padding-top: 0;
}

#rp-options-container {
    margin-top: 0;
    display: block;
}

.rp-checkbox-group {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.rp-checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rp-checkbox-group label {
    margin-bottom: 0;
    font-weight: normal;
}

.rp-checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

#rp-auto-restart-container input[type="number"] {
    width: 55px;
    padding: 2px 5px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid #ccc;
    vertical-align: middle;
    /* Helps align inside the label */
}

/* 1. General Input and Select Fields */
#rp-container input[type="number"],
#rp-container textarea,
#rp-container select {
    background-color: #fff;
    border-radius: 6px;
    border: 1px solid #ccc;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* Highlighted border on focus/active */
#rp-container input[type="number"]:focus,
#rp-container input[type="number"]:active,
#rp-container textarea:focus,
#rp-container textarea:active,
#rp-container select:focus,
#rp-container select:active {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.2);
    background-color: #fff;
}

/* Keep background white on hover */
#rp-container input[type="number"]:hover,
#rp-container textarea:hover,
#rp-container select:hover {
    background-color: #fff;
}

/* 2. Buttons */
#rp-container button:focus,
#rp-container button:active {
    outline: none;
    /* Prevents default browser outline */
}

.faq-list {
    margin-top: 1rem;
}

.faq-list dt {
    font-weight: 500;
    font-size: 1.1em;
}

.faq-list dd {
    margin-left: 0;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    padding-left: 1rem;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ddd;
}

/* Mobile-specific styles */
@media (max-width: 819px) {
    #rp-container {
        max-width: none;
        box-sizing: border-box;
        width: 100%;
        display: block;
        padding: 20px 0;
        margin: 0 auto 60px;
        box-shadow: none;
        border-radius: 0;
        border-top: 1px solid #e0e0e0;
        border-bottom: 1px solid #e0e0e0;
    }

    .rp-results-area {
        margin-top: 20px;
        display: none;
    }

    .rp-inline-fields {
        flex-direction: column;
        gap: 0;
    }

    #rp-options-container {
        flex-direction: column;
        gap: 15px;
    }

    .rp-checkbox-group {
        align-self: flex-start;
        padding-bottom: 0;
    }

    #rp-duplicate-handling {
        width: 100%;
        /* Full width on mobile */
    }

    #rp-container h2 {
        margin-bottom: 20px;
    }

    #rp-pick-btn,
    #rp-clear-btn {
        padding: 8px;
    }
}