/**
 * SCYC Dinner Meal Selection Styles
 */

.scyc-meal-guests-container {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.scyc-meal-guest-row {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.scyc-meal-guest-row:last-child {
    margin-bottom: 0;
}

.scyc-meal-guest-row h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.scyc-meal-guest-template {
    display: none;
}

.scyc-guest-name-input {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.scyc-guest-name-input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.scyc-has-allergen-checkbox {
    margin-left: 10px;
}

.scyc-has-allergen-checkbox label {
    font-size: 13px;
    color: #666;
    cursor: pointer;
}

.scyc-meal-select {
    width: 100%;
    max-width: 250px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}

.scyc-meal-select:focus {
    border-color: #0073aa;
    outline: none;
}

.scyc-meal-field {
    margin-bottom: 12px;
}

.scyc-meal-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.scyc-required {
    color: #d63638;
    font-weight: bold;
}

.scyc-dessert-field {
    display: block;
}

.scyc-add-guest-btn,
.scyc-remove-guest-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.scyc-add-guest-btn {
    background: #0073aa;
    color: #fff;
    margin-top: 10px;
}

.scyc-add-guest-btn:hover {
    background: #005177;
}

.scyc-remove-guest-btn {
    background: #dc3232;
    color: #fff;
    float: right;
}

.scyc-remove-guest-btn:hover {
    background: #a00;
}

/**
 * Guest has allergen indicator
 */
.scyc-guest-name-input.scyc-has-allergen {
    border-color: #f0ad4e;
    background: #fff8e6;
}

/**
 * Responsive adjustments
 */
@media (max-width: 600px) {
    .scyc-meal-guest-row {
        padding: 12px;
    }

    .scyc-guest-name-input,
    .scyc-meal-select {
        max-width: 100%;
    }

    .scyc-allergen-modal-content {
        padding: 15px;
        width: 95%;
    }
}

/**
 * Kitchen View Styles
 */
.scyc-kitchen-view {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.scyc-kitchen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.scyc-kitchen-header h1 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.scyc-kitchen-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.scyc-kitchen-controls select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.scyc-kitchen-refresh {
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.scyc-kitchen-refresh:hover {
    background: #005177;
}

.scyc-kitchen-section {
    margin-bottom: 30px;
}

.scyc-kitchen-section h2 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.scyc-kitchen-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.scyc-kitchen-table th,
.scyc-kitchen-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.scyc-kitchen-table th {
    background: #f5f5f5;
    font-weight: 600;
    font-size: 13px;
    color: #555;
    text-transform: uppercase;
}

.scyc-kitchen-table tr:hover {
    background: #f9f9f9;
}

.scyc-kitchen-table td {
    font-size: 14px;
    color: #333;
}

/**
 * Summary counts grid
 */
.scyc-kitchen-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.scyc-kitchen-summary-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
}

.scyc-kitchen-summary-item h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
}

.scyc-kitchen-summary-item ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.scyc-kitchen-summary-item li {
    padding: 5px 0;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.scyc-kitchen-summary-item li:last-child {
    border-bottom: none;
}

.scyc-kitchen-selector {
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
}

.scyc-kitchen-selector label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.scyc-kitchen-selector select {
    padding: 10px 15px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 300px;
    cursor: pointer;
}

#scyc-dinner-selector {
    margin-right: 10px;
}

.scyc-kitchen-back-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #0073aa;
    color: #fff !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    margin-right: 10px;
    transition: background 0.2s;
}

.scyc-kitchen-back-btn:hover {
    background: #005a87;
    color: #fff;
}

/**
 * Shortcode Meal Selection Styles
 * For [scyc_meal_selection] shortcode in Fluent Forms HTML field
 */
.scyc-meal-selection-container {
    margin: 20px auto;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    max-width: 900px;
    display: none;
}

.scyc-meal-selection-container.scyc-visible {
    display: block;
}

.scyc-meal-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.scyc-meal-header h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
}

.scyc-meal-instructions {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.scyc-meal-guests-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.scyc-meal-guest-row {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.scyc-meal-guest-row[style*="display:none"] {
    opacity: 0;
    transform: translateY(-10px);
}

.scyc-guest-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.scyc-guest-number {
    font-weight: 600;
    font-size: 14px;
    color: #0073aa;
}

.scyc-guest-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    align-items: start;
}

.scyc-field {
    display: flex;
    flex-direction: column;
}

.scyc-field label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scyc-field input[type="text"],
.scyc-field select,
.scyc-field textarea {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.scyc-field input[type="text"]:focus,
.scyc-field select:focus,
.scyc-field textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.scyc-field-name {
    grid-column: span 1;
    min-width: 150px;
}

.scyc-field-allergen {
    grid-column: 1 / -1;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e0e0e0;
}

.scyc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
}

.scyc-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.scyc-allergen-info {
    margin-top: 10px;
    min-height: 60px;
    resize: vertical;
}

.scyc-meal-error {
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
}

@media (max-width: 768px) {
    .scyc-guest-fields {
        grid-template-columns: 1fr;
    }
    
    .scyc-field-name {
        grid-column: span 1;
    }
    
    .scyc-meal-selection-container {
        padding: 15px;
    }
    
    .scyc-meal-guest-row {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .scyc-meal-header h4 {
        font-size: 16px;
    }
    
    .scyc-field label {
        font-size: 11px;
    }
}

/**
 * Table Selector Styles
 * For the "Join Existing Table" feature
 */
.scyc-table-selector-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.scyc-table-selector-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.scyc-table-selector-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    color: #1a1a2e;
    font-weight: 700;
}

.scyc-table-selector-header p {
    margin: 0;
    color: #666;
    font-size: 1rem;
}

.scyc-table-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f8f9fa;
}

.scyc-table-list::-webkit-scrollbar {
    width: 8px;
}

.scyc-table-list::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

.scyc-table-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.scyc-table-list::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.scyc-table-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.scyc-table-card:hover {
    border-color: #3e63dd;
    background: #f0f4ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(62, 99, 221, 0.15);
}

.scyc-table-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 200px;
}

.scyc-table-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
}

.scyc-table-creator {
    font-size: 0.9rem;
    color: #666;
}

.scyc-table-capacity {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    margin-right: 1rem;
}

.scyc-table-seats {
    font-size: 1rem;
    font-weight: 600;
    color: #28a745;
}

.scyc-table-occupied {
    font-size: 0.85rem;
    color: #888;
}

.scyc-table-join-btn {
    padding: 0.75rem 1.5rem;
    background: #3e63dd;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.scyc-table-join-btn:hover {
    background: #2a4db5;
    transform: scale(1.02);
}

/* Full table styles */
.scyc-table-card.scyc-table-full {
    background: #f5f5f5;
    border-color: #ddd;
    opacity: 0.8;
}

.scyc-table-card.scyc-table-full:hover {
    transform: none;
    box-shadow: none;
    border-color: #ddd;
    background: #f5f5f5;
}

.scyc-table-full-text {
    color: #dc3545 !important;
}

.scyc-table-full-btn {
    background: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
}

.scyc-table-full-btn:hover {
    background: #ccc !important;
    transform: none !important;
}

.scyc-table-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
}

.scyc-table-divider::before,
.scyc-table-divider::after {
    content: '';
    flex: 1;
    border-bottom: 2px solid #e9ecef;
}

.scyc-table-divider span {
    padding: 0 1rem;
    color: #888;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
}

.scyc-no-tables {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.scyc-no-tables p {
    margin: 0.5rem 0;
    color: #666;
}

.scyc-no-tables p:first-child {
    font-weight: 600;
    color: #1a1a2e;
}

.scyc-create-table-section {
    text-align: center;
}

.scyc-create-table-btn {
    padding: 1rem 2.5rem;
    background: #fff;
    color: #3e63dd;
    border: 2px solid #3e63dd;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scyc-create-table-btn:hover {
    background: #3e63dd;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(62, 99, 221, 0.25);
}

/* Responsive adjustments for table selector */
@media (max-width: 600px) {
    .scyc-table-selector-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .scyc-table-selector-header h3 {
        font-size: 1.5rem;
    }
    
    .scyc-table-list {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        max-height: 50vh;
        padding-right: 0.25rem;
    }
    
    .scyc-table-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: 100%;
        max-width: 100%;
        padding: 1rem;
    }
    
    .scyc-table-info {
        margin-bottom: 0.75rem;
        align-items: center;
        flex: none;
        min-width: 0;
        width: 100%;
    }
    
    .scyc-table-capacity {
        align-items: center;
        margin-right: 0;
        margin-bottom: 0.75rem;
        flex: none;
    }
    
    .scyc-table-join-btn {
        width: 100%;
    }
    
    .scyc-create-table-btn {
        width: 100%;
    }
}

/* Tablet adjustments */
@media (min-width: 601px) and (max-width: 900px) {
    .scyc-table-list {
        max-height: 55vh;
    }
}

/* Desktop adjustments */
@media (min-width: 901px) {
    .scyc-table-list {
        max-height: 60vh;
    }
}

/**
 * Loading Overlay for Orphan Table Creation
 */
.scyc-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.scyc-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top-color: #3e63dd;
    border-radius: 50%;
    animation: scyc-spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.scyc-loading-overlay p {
    margin: 0;
    font-size: 1rem;
    color: #666;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}