/* Lottery Modal Beautification Styles */

/* Lottery Modal Container */
.ttrs-lottery-modal {
    max-width: 600px;
    scale: 0.8;
    border-radius: 8px;
    overflow: scroll;

    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: #fff;
}

/* Lottery Modal Header */
.ttrs-lottery-header {
    background: #dcdddd;
    padding: 20px;
    display: flex;
    align-items: center;
    text-align: start;
    position: relative;
    border-radius: 8px 8px 0 0;
}

.ttrs-lottery-icon {
    font-size: 24px;
}

.ttrs-lottery-title {
    flex: 1;
    text-align:start;
}

.ttrs-lottery-title h3 {
    margin: 0;
    font-size: 24px;
    text-align:start;
    font-weight: 600;
    color: #252525;
}

.ttrs-lottery-subtitle {
    margin: 4px 0 0 0;
    text-align:start;
    font-size: 14px;
    color: #666;
}

.ttrs-lottery-header .ttrs-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #252525;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.ttrs-lottery-header .ttrs-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

/* Lottery Modal Content */
.ttrs-lottery-content {
    background: white;
    padding: 20px;
    overflow-y: auto !important;
}

/* Login Required State */
.ttrs-lottery-login-required {
    text-align: center;
    padding: 40px 20px;
}

.ttrs-login-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: #666;
}

.ttrs-lottery-login-required h4 {
    margin: 0 0 12px 0;
    font-size: 20px;
    color: #333;
}

.ttrs-lottery-login-required p {
    margin: 0 0 24px 0;
    color: #666;
    line-height: 1.5;
}

.ttrs-login-btn {
    display: inline-block;
    background: #45a049;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
}

.ttrs-login-btn:hover {
    background: #3d8b40;
    color: white;
    text-decoration: none;
}

/* Welcome Section */
.ttrs-lottery-welcome {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f9f9f9;
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.ttrs-welcome-avatar img {
    border-radius: 50%;
}

.ttrs-welcome-text h4 {
    margin: 0 0 4px 0;
    font-size: 18px;
    color: #333;
}

.ttrs-welcome-text p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Lottery Form */
.ttrs-lottery-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Form Groups */
.ttrs-lottery-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.ttrs-label-icon {
    margin-right: 8px;
}

/* Date Input */
.ttrs-date-input-wrapper {
    position: relative;
}

.ttrs-lottery-date-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    background: white;
}

.ttrs-lottery-date-input:focus {
    outline: none;
    border-color: #45a049;
}

/* Preference Options */
.ttrs-preference-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.ttrs-preference-option {
    position: relative;
}

.ttrs-preference-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ttrs-preference-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.ttrs-preference-card:hover {
    border-color: #45a049;
}

.ttrs-preference-option input[type="radio"]:checked + .ttrs-preference-card {
    border-color: #45a049;
    background-color: #f0f9f0;
}

.ttrs-preference-icon {
    font-size: 20px;
    color: #666;
}

.ttrs-preference-content {
    flex: 1;
}

.ttrs-preference-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    color: #333;
}

.ttrs-preference-time {
    font-size: 12px;
    color: #666;
}

/* Textarea */
.ttrs-lottery-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s ease;
}

.ttrs-lottery-textarea:focus {
    outline: none;
    border-color: #45a049;
}

/* Info Section */
.ttrs-lottery-info {
    background: #f9f9f9;
    padding: 16px;
    border-radius: 4px;
}

.ttrs-info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.ttrs-info-icon {
    font-size: 16px;
    margin-top: 2px;
    color: #666;
}

.ttrs-info-text {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* Lottery Footer */
.ttrs-lottery-footer {
    background: #f9f9f9;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
}

.ttrs-lottery-cancel,
.ttrs-lottery-submit {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-width: 120px;
    justify-content: center;
}

.ttrs-lottery-cancel {
    background: #f9f9f9;
    color: #666;
    border: 1px solid #ddd;
}

.ttrs-lottery-cancel:hover {
    background: #e9ecef;
    border-color: #ddd;
}

.ttrs-lottery-submit {
    background: #45a049;
    color: white;
    border: 1px solid transparent;
}

.ttrs-lottery-submit:hover {
    background: #3d8b40;
}

.ttrs-lottery-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.ttrs-btn-icon {
    font-size: 16px;
}

/* Feedback Messages */
.ttrs-lottery-feedback {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}

.ttrs-lottery-feedback .ttrs-feedback-message {
    font-weight: 600;
}

.ttrs-lottery-feedback .ttrs-success {
    background: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
}

.ttrs-lottery-feedback .ttrs-error {
    background: #f2dede;
    border: 1px solid #ebccd1;
    color: #a94442;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ttrs-lottery-modal {
        max-width: 95%;
        margin: 10px;
    }
    
    .ttrs-lottery-content {
        padding: 20px;
    }
    
    .ttrs-lottery-header {
        padding: 20px;
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .ttrs-lottery-title {
        order: 2;
    }
    
    .ttrs-lottery-icon {
        order: 1;
    }
    
    .ttrs-lottery-footer {
        padding: 16px;
        flex-direction: column;
    }
    
    .ttrs-lottery-cancel,
    .ttrs-lottery-submit {
        width: 100%;
    }
    
    .ttrs-preference-options {
        grid-template-columns: 1fr;
    }
    
    .ttrs-lottery-welcome {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .ttrs-lottery-title h3 {
        font-size: 20px;
    }
    
    .ttrs-lottery-subtitle {
        font-size: 13px;
    }
    
    .ttrs-lottery-content {
        padding: 16px;
    }
    
    .ttrs-lottery-header {
        padding: 16px;
    }
}
/* Player Selection Styles */
.ttrs-lottery-player-count-group {
    margin-bottom: 20px;
}

.ttrs-lottery-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    background: white;
}

.ttrs-lottery-select:focus {
    outline: none;
    border-color: #45a049;
}

.ttrs-player-section {
    background: #f9f9f9;
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    border: 1px solid #e0e0e0;
}

.ttrs-player-section-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.ttrs-player-type-group {
    margin-bottom: 12px;
}

.ttrs-radio-group {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.ttrs-radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
}

.ttrs-radio-label input[type="radio"] {
    cursor: pointer;
}

.ttrs-lottery-label-small {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.ttrs-lottery-select-small {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: white;
}

.ttrs-lottery-select-small:focus {
    outline: none;
    border-color: #45a049;
}

.ttrs-player-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.ttrs-form-group-half {
    margin-bottom: 0;
}

.ttrs-member-select {
    margin-bottom: 12px;
}

.ttrs-member-search {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.ttrs-member-search:focus {
    outline: none;
    border-color: #45a049;
}

.ttrs-guest-fields {
    margin-bottom: 12px;
}

.ttrs-lottery-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 8px;
}

.ttrs-lottery-input:focus {
    outline: none;
    border-color: #45a049;
}

.ttrs-guest-contact-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ttrs-guest-contact-field {
    margin-bottom: 0;
}

.ttrs-lottery-input-small {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.ttrs-lottery-input-small:focus {
    outline: none;
    border-color: #45a049;
}

/* Autocomplete UI styles */
.ui-autocomplete {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10000 !important;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ui-menu-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
}

.ui-menu-item:hover,
.ui-state-active {
    background: #f0f9f0;
    color: #333;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ttrs-player-fields-row {
        grid-template-columns: 1fr;
    }
    
    .ttrs-guest-contact-row {
        grid-template-columns: 1fr;
    }
}

/* Better modal scrolling */
.ttrs-lottery-content {
    max-height: calc(100vh - 250px);
    overflow-y: auto !important;
}

/* Proper spacing for player sections */
#ttrs-lottery-players-container {
    margin-top: 16px;
}

/* Force display for member select initially */
.ttrs-member-select {
    display: block !important;
}

.ttrs-guest-fields {
    display: none !important;
}

/* Show when toggled */
.ttrs-guest-fields[style*="display: block"] {
    display: block !important;
}

/* Better input styles */
.ttrs-lottery-input,
.ttrs-lottery-input-small,
.ttrs-member-search {
    box-sizing: border-box;
}

/* Form group styles */
.ttrs-form-group {
    margin-bottom: 12px;
}

/* Hide required asterisk for cleaner look */
.ttrs-player-section input:required,
.ttrs-player-section select:required {
    box-shadow: none;
}

/* jQuery UI autocomplete visibility fix */
.ui-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100000 !important;
}

/* Make sure radio buttons are visible */
.ttrs-player-type-radio {
    width: auto !important;
    height: auto !important;
    margin-right: 6px;
}

/* Better label alignment */
.ttrs-radio-label {
    margin-bottom: 0;
    font-weight: normal;
}
