/**
 * Public styles for the Tappoo Giveaway plugin
 */

/* Form styling */
.tappoo-giveaway-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tappoo-giveaway-form h2 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.tappoo-form-row {
    margin-bottom: 20px;
}

.tappoo-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #000;
}

.tappoo-form-row small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* File upload styling */
.selected-file-name {
    margin-top: 10px;
    padding: 8px 12px;
    background-color: #e6f7ff;
    border: 1px solid #91d5ff;
    border-radius: 4px;
    color: #0073aa;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.selected-file-name:before {
    content: '✓';
    margin-right: 8px;
    font-weight: bold;
}

.tappoo-form-row input[type="text"],
.tappoo-form-row input[type="number"],
.tappoo-form-row input[type="tel"],
.tappoo-form-row textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.tappoo-form-row textarea {
    height: 100px;
}

.tappoo-form-row .tappoo-checkbox-group {
    margin-top: 10px;
}

.tappoo-form-row .tappoo-checkbox-item {
    margin-bottom: 8px;
}

.tappoo-form-row .tappoo-checkbox-item label {
    display: inline;
    font-weight: normal;
    margin-left: 5px;
}

.tappoo-form-row .required {
    color: #e32;
    margin-left: 3px;
}

.tappoo-terms-container {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
}

.tappoo-form-submit {
    text-align: center;
    margin-top: 30px;
}

.tappoo-form-submit button {
    padding: 12px 30px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.tappoo-form-submit button:hover {
    background-color: #005f8b;
}

.tappoo-form-submit button:disabled {
    background-color: #999;
    cursor: not-allowed;
}

.tappoo-form-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: tappoo-spinner 0.6s linear infinite;
    vertical-align: middle;
    display: none;
}

@keyframes tappoo-spinner {
    to {
        transform: rotate(360deg);
    }
}

.tappoo-error {
    color: #e32;
    background-color: #ffebeb;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid #e32;
}

/* Giveaway status messages */
.tappoo-notice {
    color: #856404;
    background-color: #fff3cd;
    padding: 15px 20px;
    border-radius: 4px;
    margin: 30px auto;
    border-left: 4px solid #ffeeba;
    font-size: 16px;
    max-width: 800px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.tappoo-giveaway-status {
    display: block;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #444;
}

.tappoo-status-upcoming {
    color: #0073aa;
    background-color: #e6f6ff;
    border-left-color: #0073aa;
}

.tappoo-status-ended {
    color: #666;
    background-color: #f1f1f1;
    border-left-color: #999;
}

.tappoo-success {
    color: #155724;
    background-color: #d4edda;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid #c3e6cb;
}

/* Form success message */
.tappoo-success-message {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tappoo-success-message h2 {
    color: #155724;
    margin-bottom: 20px;
}

.tappoo-success-message p {
    font-size: 16px;
    margin-bottom: 30px;
}

/* Entries Table Styling */
.tappoo-entries-container {
    max-width: 100%;
    margin: 30px 0;
    overflow-x: auto;
}

.tappoo-entries-container h2 {
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.tappoo-entries-count {
    margin-bottom: 15px;
    font-weight: bold;
    color: #333;
}

.tappoo-entries-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tappoo-entries-table th,
.tappoo-entries-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.tappoo-entries-table th {
    background-color: #f5f5f5;
    font-weight: bold;
    color: #333;
}

.tappoo-entries-table tr:hover {
    background-color: #f9f9f9;
}

.tappoo-winner-badge {
    display: inline-block;
    padding: 3px 8px;
    background-color: #28a745;
    color: #fff;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.tappoo-disqualified-badge {
    display: inline-block;
    padding: 3px 8px;
    background-color: #dc3545;
    color: #fff;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.tappoo-entries-pagination {
    margin-top: 20px;
    text-align: center;
}

.tappoo-entries-pagination .tappoo-page {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 3px;
    border: 1px solid #ddd;
    text-decoration: none;
    border-radius: 3px;
    color: #0073aa;
}

.tappoo-entries-pagination .tappoo-page.current {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.tappoo-entries-pagination .tappoo-page:hover {
    background-color: #f5f5f5;
}

.tappoo-entries-pagination .tappoo-page.current:hover {
    background-color: #0073aa;
}

/* Winners Table Styling */
.tappoo-winners-container {
    max-width: 100%;
    margin: 30px 0;
    overflow-x: auto;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.1);
    padding: 15px;
}

.tappoo-winners-count {
    margin-bottom: 15px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.tappoo-winners-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tappoo-winners-table th,
.tappoo-winners-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    vertical-align: middle;
}

.tappoo-winners-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.tappoo-winners-table tr:last-child td {
    border-bottom: none;
}

.tappoo-winners-table tr:nth-child(even) {
    background-color: #fafafa;
}

.tappoo-winners-table tr:hover {
    background-color: #f5f7fa;
}

/* Handle long content in certain columns */
.tappoo-winners-table td:nth-child(2), /* Shop Address */
.tappoo-winners-table td:nth-child(6) { /* Promotion Source */
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tappoo-winners-table td:nth-child(3) { /* Age */
    text-align: center;
    width: 60px;
}

.tappoo-winners-table th:last-child,
.tappoo-winners-table td:last-child { /* Status column */
    width: 120px;
}

/* Make receipt link stand out */
.tappoo-winners-table a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.tappoo-winners-table a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.disqualify-winner {
    background-color: transparent;
    color: #007bff;
    border: 1px solid #007bff;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.disqualify-winner:hover {
    background-color: #f1f8ff;
    color: #0056b3;
}

.tappoo-winners-table tr.disqualified {
    background-color: #fff5f5;
}

.disqualified-status {
    display: inline-block;
    padding: 3px 8px;
    background-color: #dc3545;
    color: #fff;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.disqualification-reason {
    margin-top: 8px;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
    background-color: #f8f9fa;
    padding: 6px 10px;
    border-radius: 3px;
    border-left: 3px solid #dc3545;
    display: inline-block;
    max-width: 300px;
}

/* Submission Animation */
.tappoo-submission-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.tappoo-submission-animation {
    background-color: white;
    padding: 30px 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 300px;
    width: 100%;
}

.tappoo-submission-animation p {
    margin-top: 20px;
    color: #333;
    font-size: 16px;
    font-weight: 500;
}

.tappoo-loading-circle {
    display: inline-block;
    width: 64px;
    height: 64px;
    border: 5px solid rgba(0, 115, 170, 0.2);
    border-radius: 50%;
    border-top-color: #0073aa;
    animation: tappoo-spin 1s ease-in-out infinite;
}

@keyframes tappoo-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive styling */
@media (max-width: 768px) {
    .tappoo-giveaway-form {
        padding: 15px;
    }
    
    .tappoo-form-submit button {
        width: 100%;
    }
    
    .tappoo-entries-table,
    .tappoo-winners-table {
        font-size: 14px;
    }
    
    .tappoo-entries-table th,
    .tappoo-entries-table td,
    .tappoo-winners-table th,
    .tappoo-winners-table td {
        padding: 8px 10px;
    }
    
    .tappoo-submission-animation {
        padding: 20px;
        max-width: 260px;
    }
}
