/* Component-specific styles */

/* Wish List Items */
.wish-list-form {
    background: var(--light-gray);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.wish-list-items h3 {
    margin-bottom: 1.5rem;
    color: var(--dark-text);
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.wish-item {
    background: white;
    border: 2px solid var(--christmas-green);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.wish-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.wish-item.purchased {
    opacity: 0.7;
    border-color: #28a745;
    background: #f0f9f0;
}

.wish-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.wish-item-header h3 {
    font-size: 1.25rem;
    color: var(--christmas-red);
    margin: 0;
    flex: 1;
}

.priority-badge {
    background: var(--christmas-gold);
    color: #333;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.priority-1 {
    background: #dc3545;
    color: white;
}

.priority-2 {
    background: var(--christmas-gold);
    color: #333;
}

.priority-3 {
    background: #28a745;
    color: white;
}

.wish-item-description {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.wish-item-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.price-tag {
    background: var(--christmas-green);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideDown 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    margin: 0;
    color: var(--christmas-red);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.modal-close:hover {
    color: var(--dark-text);
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Toggle Switch */
.preference-group {
    padding: 1.5rem;
    background: var(--light-gray);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
}

.toggle-checkbox {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background: #ccc;
    border-radius: 26px;
    transition: background 0.3s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-checkbox:checked + .toggle-slider {
    background: var(--christmas-green);
}

.toggle-checkbox:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-text {
    font-weight: 500;
    color: var(--dark-text);
}

/* Participants and Exclusions Lists */
.participant-item,
.exclusion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s;
}

.participant-item:hover,
.exclusion-item:hover {
    background: var(--light-gray);
}

.participant-info,
.exclusion-info {
    flex: 1;
}

.participant-name,
.exclusion-text {
    font-weight: 500;
    color: var(--dark-text);
}

.participant-meta {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.status-picked {
    background: #d4edda;
    color: #155724;
}

.status-not-picked {
    background: #fff3cd;
    color: #856404;
}

/* Family Group Selector */
#familyGroupSelector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.family-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.family-checkbox-label:hover {
    border-color: var(--christmas-green);
    background: #f8f9fa;
}

.family-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--christmas-green);
}

.family-checkbox-label:has(input:checked) {
    background: #e8f5e9;
    border-color: var(--christmas-green);
}

/* White icon styling for buttons */
.btn-secondary .lucide,
.btn-secondary svg {
    stroke: white !important;
    color: white !important;
}

/* Button Loading State */
.btn .btn-loader {
    display: inline-block;
    animation: spin 1s linear infinite;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Hide/Show Utilities */
.hidden {
    display: none !important;
}

/* Dashboard Layout */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.admin-header h1 {
    margin: 0;
}

.dashboard-container {
    display: grid;
    grid-template-columns: 25% 75%;
    gap: 1.5rem;
    align-items: start;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 1.5rem;
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* SMS Templates - Single Column with Collapsible Cards */
.sms-templates-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sms-template-card {
    background: white;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

/* Non-participant card styling - visually distinct */
.sms-template-card.non-participant-card {
    border-left: 4px solid var(--christmas-green);
    background: linear-gradient(to right, #f0f9f0 0%, white 10%);
}

.sms-template-card.non-participant-card .sms-template-header {
    background: linear-gradient(to right, #f0f9f0 0%, white 10%);
}

.sms-template-card.non-participant-card .sms-template-header:hover {
    background: linear-gradient(to right, #e6f4e6 0%, #f8f9fa 10%);
}

.sms-template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    background: white;
    transition: background 0.2s;
}

.sms-template-header:hover {
    background: #f8f9fa;
}

.sms-template-title-area {
    flex: 1;
}

.sms-template-card h4 {
    margin: 0 0 0.25rem 0;
    color: var(--christmas-red);
    font-size: 0.95rem;
    font-weight: 600;
}

.sms-template-card p {
    margin: 0;
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
}

.sms-template-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
}

.sms-template-toggle i,
.sms-template-toggle svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.sms-template-card.expanded .sms-template-toggle i,
.sms-template-card.expanded .sms-template-toggle svg {
    transform: rotate(180deg);
}

.sms-template-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sms-template-card.expanded .sms-template-content {
    max-height: 500px;
}

.sms-template-content-inner {
    padding: 0 1.25rem 1.25rem 1.25rem;
}

.sms-template-preview {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8rem;
    white-space: pre-wrap;
    margin-bottom: 0.75rem;
    border: 1px solid #e0e0e0;
    line-height: 1.5;
}

.sms-template-edit-area {
    display: none;
    margin-bottom: 0.75rem;
}

.sms-template-card.edit-mode .sms-template-preview {
    display: none;
}

.sms-template-card.edit-mode .sms-template-edit-area {
    display: block;
}

.sms-template-edit-area textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    font-family: monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    resize: vertical;
    background: white;
}

.sms-template-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.75rem;
}

.sms-template-char-count {
    font-size: 0.85rem;
    color: #666;
    margin-left: auto;
}

.sms-template-footer {
    padding-top: 0.5rem;
}

.widget {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.widget:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.widget-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.widget-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--christmas-red), var(--christmas-green));
    border-radius: 8px;
}

.widget-icon i,
.widget-icon svg {
    width: 20px;
    height: 20px;
    color: white;
    stroke-width: 2.5;
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-text);
    margin: 0;
}

.widget-body {
    color: var(--dark-text);
}

/* Stats Grid for Game Status */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.stat-card {
    text-align: center;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(184, 34, 40, 0.1), rgba(23, 94, 84, 0.1));
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: scale(1.05);
    border-color: var(--christmas-gold);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--christmas-red);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

/* Admin Forms */
.admin-form {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: rgba(23, 94, 84, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--christmas-green);
}

.form-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0;
}

.form-row select,
.form-row input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    background: white;
    color: var(--dark-text);
}

.form-row select:focus,
.form-row input:focus {
    outline: none;
    border-color: var(--christmas-green);
    box-shadow: 0 0 0 3px rgba(22, 91, 51, 0.1);
}

.form-row select:hover,
.form-row input:hover {
    border-color: #b0b0b0;
}

.form-row select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-row span {
    color: #666;
    font-weight: 500;
    padding: 0.5rem;
    align-self: center;
}

/* Data Tables */
.data-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-top: 1rem;
}

.data-table-scrollable {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 8px;
}

.data-table-scrollable::-webkit-scrollbar {
    width: 8px;
}

.data-table-scrollable::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.data-table-scrollable::-webkit-scrollbar-thumb {
    background: var(--christmas-green);
    border-radius: 4px;
}

.data-table-scrollable::-webkit-scrollbar-thumb:hover {
    background: var(--christmas-red);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
    font-style: italic;
}

/* Button Groups */
.btn-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* SMS Template Preview */
#smsTemplatesContainer > div,
#smsTemplateEditor > div {
    background: white;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#smsTemplatesContainer > div:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* SMS Logs Tables */
.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--christmas-green);
    color: white;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

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

.data-table tr:hover {
    background: rgba(23, 94, 84, 0.03);
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Compact Widget for Sidebar */
.widget-compact {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.widget-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.widget-compact .widget-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
}

.widget-compact .widget-icon {
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
}

.widget-compact .widget-icon i,
.widget-compact .widget-icon svg {
    width: 16px;
    height: 16px;
}

.widget-compact .widget-title {
    font-size: 0.95rem;
}

/* Multi-column button layouts for sidebar */
.btn-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.btn-grid-2col .btn {
    width: 100%;
    justify-content: center;
}

.btn-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.btn-grid-3col .btn {
    width: 100%;
    justify-content: center;
    padding: 0.5rem 0.25rem;
}

/* Icon styles for buttons and inline text */
.btn i,
.btn svg {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 0.35rem;
}

.btn-sm i,
.btn-sm svg {
    width: 14px;
    height: 14px;
}

.christmas-title i,
.christmas-title svg {
    width: 28px;
    height: 28px;
    vertical-align: middle;
    margin-right: 0.5rem;
}

h3 i,
h3 svg {
    margin-right: 0.35rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .dashboard-container {
        grid-template-columns: 35% 65%;
    }

    .sms-templates-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 968px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        position: static;
    }

    .sms-templates-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .items-grid {
        grid-template-columns: 1fr;
    }

    .wish-item-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .wish-item-footer .btn {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    #familyGroupSelector {
        grid-template-columns: 1fr;
    }

    .admin-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1.5rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        flex-direction: column;
    }

    .form-row .form-group {
        width: 100%;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        width: 100%;
    }

    .sms-templates-grid {
        grid-template-columns: 1fr;
    }
}
