/* General Layout & Containers */
.gift-list-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Admin Page Layout */
.gift-list-admin-form {
    max-width: 600px;
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.gift-lists_page_gift-list-managers .user-checkboxes {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
    margin-top: 5px;
}

.gift-lists_page_gift-list-managers .user-checkboxes label {
    display: block;
    margin-bottom: 5px;
}

.gift-lists_page_gift-list-managers .form-actions {
    margin-top: 20px;
}

.gift-lists_page_gift-list-managers .notice-container {
    margin: 20px 0;
}

.notice-container {
    margin: 1rem 0;
}

/* Form Styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #23282d;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.form-group .description {
    margin-top: 0.5rem;
    color: #666;
    font-size: 13px;
    font-style: italic;
}

.required {
    color: #d63638;
}

/* Modal Styling */
.gift-list-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 100000;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.gift-list-modal.show {
    display: block;
}

.modal-content h2 {
    margin: 0 0 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ddd;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: #d63638;
}

/* Table Styling */
.wp-list-table.users {
    margin-top: 1rem;
}

.wp-list-table th {
    font-weight: 600;
}

.column-username {
    width: 15%;
}

.column-name {
    width: 20%;
}

.column-role {
    width: 10%;
}

.column-lists {
    width: 30%;
}

.column-last-login {
    width: 15%;
}

.column-actions {
    width: 10%;
    text-align: right;
}

/* List Display */
.list-entry {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.list-shortcode {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.list-shortcode code {
    flex-grow: 1;
    padding: 0.25rem;
    background: #f0f0f1;
    font-size: 13px;
}

/* Buttons & Actions */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 1px solid;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 0.25rem;
}

.button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: white;
}

.button-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

.button-secondary {
    background: #f6f7f7;
    border-color: #2271b1;
    color: #2271b1;
}

.button-secondary:hover {
    background: #f0f0f1;
    border-color: #135e96;
    color: #135e96;
}

.button-danger {
    background: #d63638;
    border-color: #d63638;
    color: white;
}

.button-danger:hover {
    background: #b32d2e;
    border-color: #b32d2e;
}

.button.disabled,
.button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Password Strength Meter */
.password-strength-meter {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 3px;
    font-size: 13px;
    text-align: center;
}

.password-strength-meter.very-weak {
    background: #f6c9cc;
    color: #8a1f23;
}

.password-strength-meter.weak {
    background: #fde3c7;
    color: #8a4b17;
}

.password-strength-meter.medium {
    background: #fff4c7;
    color: #8a7c17;
}

.password-strength-meter.strong {
    background: #e0efc7;
    color: #4f8a17;
}

.password-strength-meter.very-strong {
    background: #c7efc7;
    color: #178a17;
}

.password-strength-meter.excellent {
    background: #c7efe8;
    color: #178a7c;
}

/* Notifications */
.notice {
    position: relative;
    padding: 1rem;
    margin: 1rem 0;
    border-left: 4px solid;
    border-radius: 0 4px 4px 0;
    background: white;
}

.notice p {
    margin: 0;
}

.notice-success {
    border-color: #00a32a;
}

.notice-error {
    border-color: #d63638;
}

.notice-warning {
    border-color: #dba617;
}

/* Spinners & Loading States */
.spinner-container {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.spinner.is-active {
    visibility: visible;
    margin: 0;
}

tr.updating {
    opacity: 0.5;
    pointer-events: none;
}

/* Password Display */
.password-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.password-display code {
    flex-grow: 1;
    padding: 0.5rem;
    font-size: 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* Tooltips */
.ui-tooltip {
    max-width: 300px;
    padding: 0.5rem 1rem;
    background: #23282d;
    color: white;
    border: none;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-size: 13px;
}

/* Frontend Login Form */
.gift-list-login-form {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.gift-list-login-form h2 {
    margin: 0 0 1.5rem;
    text-align: center;
    color: #23282d;
}

.gift-list-login-form .error-message {
    display: none;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 4px;
    background: #f8d7da;
    color: #842029;
}

/* Dashboard */
.list-type-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 1rem;
}

.list-type-tab {
    padding: 0.75rem 1.5rem;
    background: #f6f7f7;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.list-type-tab:hover {
    background: #f0f0f1;
}

.list-type-tab.active {
    background: #2271b1;
    border-color: #2271b1;
    color: white;
}

.gift-list-login-form {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.gift-list-login-form h2 {
    margin: 0 0 1.5rem;
    text-align: center;
    color: #23282d;
}

.gift-list-login-form .form-group {
    margin-bottom: 1rem;
}

.gift-list-login-form label {
    display: block;
    margin-bottom: 0.5rem;
}

.gift-list-login-form input[type="text"],
.gift-list-login-form input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.gift-list-login-form .error-message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8d7da;
    border-radius: 4px;
    color: #842029;
}

.gift-list-login-form button {
    width: 100%;
    padding: 0.75rem;
    background: #2271b1;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
}

.gift-list-login-form button:hover {
    background: #135e96;
}

/* Responsive Design */
@media screen and (max-width: 782px) {
    .wp-list-table .column-lists,
    .wp-list-table .column-last-login {
        display: none;
    }
    
    .modal-content {
        margin: 1rem;
        padding: 1rem;
    }
    
    .list-type-tabs {
        flex-direction: column;
    }
    
    .list-type-tab {
        text-align: center;
    }
    
    .button {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .password-display {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Print Styles */
@media print {
    .gift-list-modal,
    .button,
    .notice-dismiss {
        display: none !important;
    }
    
    .list-entry {
        page-break-inside: avoid;
    }
}

/* RTL Support */
.rtl .notice {
    border-left: none;
    border-right: 4px solid;
    border-radius: 4px 0 0 4px;
}

.rtl .close {
    right: auto;
    left: 1rem;
}

.rtl .button .dashicons {
    margin-right: 0;
    margin-left: 0.25rem;
}

.remove-managed-user {
    margin-left: 10px;
    padding: 2px;
    line-height: 1;
    height: auto;
}

.remove-managed-user .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
    line-height: 1;
}

.managed-users-list li {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.manager-hierarchy {
    margin: 20px 0;
    padding: 15px;
}

.hierarchy-visualization {
    margin-top: 15px;
    padding: 10px;
    border: 1px solid #ccd0d4;
    background: #fff;
}

.hierarchy-level {
    margin-bottom: 20px;
}

.hierarchy-level h4 {
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.hierarchy-relations {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hierarchy-relations li {
    margin: 5px 0;
    padding: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hierarchy-arrow {
    color: #666;
    font-weight: bold;
}

.senior-manager {
    font-weight: bold;
    color: #1e88e5;
}

.junior-manager {
    color: #43a047;
}

/* Manager Groups Styling */
.manager-groups {
    margin: 20px 0;
}

.manager-groups-table {
    margin-top: 15px;
}

.group-members {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.manager-checkboxes {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
    margin-top: 5px;
}

.checkbox-label {
    display: block;
    margin: 5px 0;
}

.checkbox-label input {
    margin-right: 5px;
}

/* Modal Adjustments for Groups */
#manager-group-modal .modal-content,
#add-group-member-modal .modal-content {
    max-width: 600px;
}

/* Group Action Buttons */
.manager-groups .action-buttons {
    display: flex;
    gap: 10px;
}

/* Group Member List */
.group-members-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.group-members-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

.group-members-list li:last-child {
    border-bottom: none;
}

.managed-by-indicator,
.hierarchy-level-indicator {
    display: inline-block;
    margin-left: 5px;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 12px;
    background: #f0f0f1;
}

.manager-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.relationship-date {
    font-size: 12px;
    color: #666;
}

.has-hierarchy {
    background-color: #f8f9fa;
}

.level-1 { border-left: 3px solid #2196f3; }
.level-2 { border-left: 3px solid #4caf50; }
.level-3 { border-left: 3px solid #ff9800; }
.level-4 { border-left: 3px solid #9c27b0; }
.level-5 { border-left: 3px solid #f44336; }
