/* Wedding Guest List Manager Styles */

.wedding-guest-list-app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    direction: rtl;
    text-align: right;
}

.guest-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.guest-list-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    color: #db3535;
}

.guest-list-settings-btn {
    background: #db3535;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(219, 53, 53, 0.3);
}

.guest-list-settings-btn:hover {
    background: #333;
    color: #fff;
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(51, 51, 51, 0.4);
}

/* Modal Styles */
.guest-list-modal {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: auto;
}

.guest-list-modal-content {
    position: relative;
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-height: 80vh;
    overflow-y: auto;
}

.guest-list-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #888;
    transition: color 0.2s ease;
}

.guest-list-modal-close:hover {
    color: #000;
}

.guest-list-modal-body {
    margin-bottom: 10px;
}

.instructions-content h4 {
    color: #db3535;
    font-size: 20px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
    text-align: center;
}

.guest-list-tips {
    color: #db3535 !important;
    margin-top: 25px;
    background: linear-gradient(135deg, #fff3cd, #ffeaa7) !important;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px !important;
    margin: 20px 0 !important;
    text-align: center !important;
}

.guest-list-tips ul {
    background: transparent !important;
    margin: 10px 0 0 0 !important;
}

.guest-list-tips ul li {
    background: rgba(255, 255, 255, 0.3) !important;
    border-right-color: #856404 !important;
}

.instructions-content ul {
    list-style: none;
    padding-right: 0;
}

.instructions-content li {
    background: #f8f9fa;
    margin-bottom: 1px;
    padding: 10px 15px;
    border-radius: 6px;
    position: relative;
    border-bottom: 1px solid #e9ecef;
}



.instructions-content li::before {
    content: "✓";
    color: #28a745;
    font-weight: bold;
    margin-left: 10px;
    font-size: 14px;
}

.guest-list-modal-footer {
    border-top: 1px solid #e9ecef;
    padding-top: 10px;
    text-align: left;
}

.modal-action-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.guest-list-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 100px;
}

.guest-list-btn-warning {
    background-color: #ffc107;
    color: #856404;
    border: 1px solid #ffc107;
}

.guest-list-btn-warning:hover {
    background-color: #e0a800;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

.guest-list-btn-danger {
    background-color: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.guest-list-btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.guest-list-loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}

.mobile-view-selector {
    display: none;
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.mobile-view-selector .view-btn {
    flex: 1;
    padding: 5px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #6c757d;
}

.mobile-view-selector .view-btn.active,
.mobile-view-selector .view-btn:hover {
    background: #fff;
    color: #007bff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.guest-list-content {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.guest-list-content.desktop {
    min-height: 400px;
}

.guest-list-content.mobile {
    flex-direction: column;
    gap: 15px;
}

.guest-list-divider {
    width: 2px;
    background: linear-gradient(to bottom, #e9ecef, #007bff, #e9ecef);
    margin: 0 10px;
    border-radius: 1px;
    position: relative;
}

.guest-list-divider::before {
    content: '💍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 5px;
    border-radius: 50%;
    font-size: 16px;
}

.guest-side {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.guest-side:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.groom-side {
    border-top: 4px solid #007bff;
}

.bride-side {
    border-top: 4px solid #db3535;
}

.side-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

.side-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #343a40;
    display: flex;
    align-items: center;
    gap: 10px;
}

.side-header h3 i {
    font-size: 28px;
}

.groom-side .side-header h3 {
    color: #007bff;
}

.bride-side .side-header h3 {
    color: #db3535;
}

.side-count {
    background: #6c757d;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    min-width: 30px;
    text-align: center;
}

.groom-side .side-count {
    background: #007bff;
}

.bride-side .side-count {
    background: #db3535;
}

.categories {
    padding: 20px;
    min-height: 200px;
}

.guest-category {
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.guest-category.collapsed {
    border-bottom: 1px solid #e9ecef;
}

.guest-category.expanded {
    border: 1px solid #e9ecef;
    background: #f8f9fa;
}

.guest-category:hover,
.guest-category.expanded {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.1);
}

.category-guests {
    background: aliceblue;
    border-top: 2px solid #dee2e6;
    margin: 0;
}

.guest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    margin: 8px 16px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.guest-item:hover {
    border-color: #007bff;
    box-shadow: 0 1px 4px rgba(0,123,255,0.1);
}

.bride-side .guest-item:hover {
    border-color: #db3535;
    box-shadow: 0 1px 4px rgba(219,53,53,0.1);
}

.guest-name {
    flex: 1;
    border: none !important;
    border-bottom: 1px dashed #c6c6c6 !important;
    background: transparent;
    font-size: 14px;
    color: #343a40;
    padding: 6px 8px;
    /* border-radius: 4px; */

}

.guest-name:focus {
    outline: none;
    background: #e3f2fd;
}

.delete-guest-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #dc3545;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.delete-guest-btn:hover {
    background: #f8d7da;
    color: #721c24;
}

.add-section {
    padding: 0 20px 20px;
    position: relative;
}

.add-category-btn {
    width: 100%;
    padding: 12px;
    border: 2px dashed #007bff;
    background: transparent;
    color: #007bff;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.add-category-btn:hover {
    background: #e3f2fd;
    border-color: #0056b3;
    color: #0056b3;
}

.bride-side .add-category-btn {
    border-color: #db3535;
    color: #db3535;
}

.bride-side .add-category-btn:hover {
    background: #fce4ec;
    border-color: #b71c1c;
    color: #b71c1c;
}

.add-dropdown {
    position: absolute;
    top: -100%;
    left: 20px;
    right: 20px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    overflow: hidden;
}

.dropdown-option {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    text-align: right;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 14px;
    color: #343a40;
}

.dropdown-option:hover {
    background: #f8f9fa;
}

.dropdown-option:not(:last-child) {
    border-bottom: 1px solid #e9ecef;
}

.groom-side .dropdown-option:hover {
    background: #e3f2fd;
    color: #007bff;
}

.bride-side .dropdown-option:hover {
    background: #fce4ec;
    color: #db3535;
}

.add-guest-btn {
    width: 100%;
    padding: 12px;
    border: 2px dashed #007bff;
    background: transparent;
    color: #007bff;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
}

.add-guest-btn:hover {
    background: #e3f2fd;
    border-color: #0056b3;
    color: #0056b3;
}

.bride-side .add-guest-btn {
    border-color: #db3535;
    color: #db3535;
}

.bride-side .add-guest-btn:hover {
    background: #fce4ec;
    border-color: #b71c1c;
    color: #b71c1c;
}

.guest-list-totals {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #343a40;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-bottom: 15px;
}

.total-counts {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.groom-count {
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    border: 2px solid rgba(0, 123, 255, 0.2);
}

.bride-count {
    color: #db3535;
    background: rgba(219, 53, 53, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    border: 2px solid rgba(219, 53, 53, 0.2);
}



.grand-total {
    font-size: 26px;
    font-weight: 800;
    color: #db3535;
    text-align: center;
    padding: 8px;
    width: 100%;
}

/* Sync Status Icon - Following Documentation & Budget Tool Design */
#wgl-sync-status-icon {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Sync Status Colors - Following Documentation Specifications */
#wgl-sync-status-icon.sync-not-saved {
    background-color: #ff3547; /* Red - Not saved */
}

#wgl-sync-status-icon.sync-local {
    background-color: #ffbb33; /* Yellow - LocalStorage only */
}

#wgl-sync-status-icon.sync-progress {
    background-color: #4285f4; /* Blue - Syncing */
}

#wgl-sync-status-icon.sync-complete {
    background-color: #00c851; /* Green - Synced with server */
}

#wgl-sync-status-icon.sync-indexeddb {
    background-color: #673ab7; /* Purple - IndexedDB */
}

/* Fixed position icon sizing - all icons white */
#wgl-sync-status-icon i {
    font-size: 16px;
    color: white !important;
}

/* Spinning animation for syncing state */
#wgl-sync-status-icon.sync-progress i {
    animation: wgl-sync-spin 1.5s linear infinite;
}

@keyframes wgl-sync-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hover effect */
#wgl-sync-status-icon:hover {
    transform: scale(1.1);
}

/* Tooltip for sync status */
#wgl-sync-status-icon .sync-tooltip {
    position: absolute;
    bottom: 50px;
    right: 0;
    background-color: #333;
    color: white;
    padding: 10px 12px;
    border-radius: 5px;
    width: 200px;
    display: none;
    flex-direction: column;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    font-size: 12px;
    white-space: nowrap;
}

#wgl-sync-status-icon:hover .sync-tooltip {
    display: flex;
}

#wgl-sync-status-icon .sync-tooltip:after {
    content: '';
    position: absolute;
    top: 100%;
    right: 10px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

#wgl-sync-status-icon .sync-tooltip #sync-status-message {
    font-weight: bold;
    margin-bottom: 5px;
}

#wgl-sync-status-icon .sync-tooltip .time-info {
    font-size: 11px;
    color: #ccc;
    margin-top: 4px;
}

#wgl-sync-status-icon .sync-tooltip .time-info .hidden {
    display: none;
}

@media (max-width: 768px) {
    .wedding-guest-list-app {
        padding: 5px;
    }
    
    .guest-list-header {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .guest-list-header h2 {
        font-size: 20px;
    }
    
    .guest-list-settings-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
        background: #db3535;
        border: none;
        color: #fff;
        box-shadow: 0 2px 6px rgba(219, 53, 53, 0.3);
    }
    
    .guest-list-modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
        max-height: 75vh;
    }
    
    .guest-list-modal-close {
        top: 10px;
        right: 15px;
        font-size: 24px;
    }
    
    .instructions-content h4 {
        font-size: 18px;
    }
    
    .instructions-content li {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .modal-action-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .guest-item{
        margin: 0px;    
    }
    
    .guest-list-btn {
        width: 100%;
        padding: 12px 20px;
    }
    
    .mobile-view-selector {
        display: flex;
    }
    
    .guest-list-content.mobile.view-groom .bride-side,
    .guest-list-content.mobile.view-bride .groom-side {
        display: none;
    }
    
    .guest-list-divider {
        display: none;
    }
    
    .side-header {
        padding: 10px;
    }
    
    .side-header h3 {
        font-size: 18px;
    }
    
    .side-header h3 i {
        font-size: 20px;
    }
    
    .categories {
        padding: 5px;
    }
    
    .add-section {
        padding: 0 10px 10px;
    }
    
    .category-header {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 12px;
    }
    
    .category-header .guest-count {
        min-width: 10px;
        padding: 5px;
    }
    
    .category-titles {
        margin-bottom: 4px;
        padding: 4px 12px;
        font-size: 11px;
        gap: 6px;
    }
    

    
    .category-content {
        padding: 10px;
    }
    
    .category-name {
        padding: 0px 5px;
    }
    
    .count-controls {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        width: 100%;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .count-only-toggle {
        font-size: 14px;
    }
    
    .manual-count {
        width: 100px;
        align-self: center;
    }
    
    .add-dropdown {
        left: 15px;
        right: 15px;
    }
    
    /* Mobile responsive adjustments for sync status icon */
    #wgl-sync-status-icon {
        bottom: 10px;
        left: 10px;
        width: 35px;
        height: 35px;
    }

    #wgl-sync-status-icon i {
        font-size: 14px;
    }

    #wgl-sync-status-icon .sync-tooltip {
        width: 150px;
        right: -10px;
    }
}

@media (min-width: 769px) {
    .count-controls {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 100%;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .manual-count {
        width: 80px;
        align-self: center;
    }
}

.category-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    gap: 8px;
}

.category-header .toggle-btn {
    order: 0;
    min-width: 20px;
}

.category-header .category-name {
    order: 1;
    flex: 1;
    border: none !important;
    border-bottom: 1px dashed #c6c6c6 !important;
}

.category-header .guest-count {
    order: 2;
    min-width: 10px;
    text-align: center;
}

.category-header .delete-category-btn {
    order: 3;
    min-width: 30px;
}

.guest-category.collapsed .category-header {
    border-bottom: none;
}

.toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #6c757d;
    transition: color 0.2s ease;
}

.toggle-btn:hover {
    color: #007bff;
}

.category-name {
    flex: 1;
    border: none;
    border-bottom: 1px solid #e9ecef;
    background: transparent;
    font-size: 16px;
    font-weight: 500;
    color: #343a40;
    padding: 8px 12px;
    transition: border-bottom-color 0.2s ease;
}

.category-name:focus {
    outline: none;
    border-bottom-color: #007bff;
}

.category-content {
    background: aliceblue;
    padding: 16px;
}

.count-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    margin-bottom: 10px;
    width: 100%;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.count-mode-toggle {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    overflow: hidden;
    width: 100%;
    max-width: 240px;
}

.toggle-option {
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    white-space: nowrap;
    flex: 1;
    text-align: center;
    font-weight: 500;
}

.toggle-option:hover {
    background: #e9ecef;
}

.toggle-option.active {
    background: #007bff;
    color: white;
}

.groom-side .toggle-option.active {
    background: #007bff;
}

.bride-side .toggle-option.active {
    background: #db3535;
}

.count-only-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #6c757d;
    cursor: pointer;
    white-space: nowrap;
}

.count-only-toggle input[type="checkbox"] {
    margin: 0;
}

.manual-count {
    width: 100px;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 15px;
    text-align: center;
    align-self: center;
    font-weight: 600;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.manual-count:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    background: #fff;
}

.guest-count {
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.delete-category-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #dc3545;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.delete-category-btn:hover {
    background: #f8d7da;
    color: #721c24;
}

.category-titles {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px 6px 0 0;
    font-weight: 600;
    font-size: 14px;
    color: #495057;
    margin-bottom: 8px;
}

.title-name {
    text-align: center;
}

@media (max-width: 488px) {
    .category-header{
        padding: 10px 2px;
        gap: 8px;
    }
    .category-header .category-name{
        padding: 5px;
    }
    .guest-name{
        padding: 5px !important;
    }
}

.guest-category.individual .category-header {
    background: #fff;
}

.guest-category.group .category-header {
    background: #fff;
}

.guest-category.individual .category-header .category-name {
    color: #343a40;
}

.guest-category.group .category-header .category-name {
    color: #343a40;
}

.guest-category.individual .guest-count {
    background: #e9ecef;
    color: #495057;
}

.guest-category.group .guest-count {
    background: #e9ecef;
    color: #495057;
}

.dropdown-option[data-type="group"] {
    color: #343a40;
}

.dropdown-option[data-type="individual"] {
    color: #343a40;
}

.dropdown-option[data-type="group"]:hover {
    background: #f8f9fa;
}

.dropdown-option[data-type="individual"]:hover {
    background: #f8f9fa;
}

.bride-side .guest-category.individual .category-header {
    background: #fff;
}

.bride-side .guest-category.individual .category-header .category-name {
    color: #343a40;
}

.bride-side .guest-category.individual .guest-count {
    background: #e9ecef;
    color: #495057;
}

.bride-side .dropdown-option[data-type="individual"] {
    color: #343a40;
}

.bride-side .dropdown-option[data-type="individual"]:hover {
    background: #f8f9fa;
}

.category-name-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.category-name-wrapper i {
    color: inherit;
    font-size: 16px;
}

.category-name-wrapper .category-name {
    flex: 1;
    border: none !important;
    border-bottom: 1px dashed #c6c6c6 !important;
    background: transparent;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 12px;
    transition: border-bottom-color 0.2s ease;
}

.category-name-wrapper .category-name:focus {
    outline: none;
    border-bottom-color: #007bff;
}

.bride-side .category-name-wrapper .category-name:focus {
    border-bottom-color: #db3535;
}