/**
 * User Management Styles
 * 사용자 관리 탭 스타일
 */

/* Container */
.user-management-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header Section */
.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.user-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

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

/* Search Box */
.search-box {
    position: relative;
}

.user-search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 250px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.user-search-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

/* Status Filter Box */
.status-filter-box {
    position: relative;
}

.status-filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 120px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: white;
}

.status-filter-select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.refresh-btn {
    padding: 8px 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.refresh-btn:hover {
    background: #45a049;
}

/* Table Container */
.user-table-container {
    flex: 1;
    overflow: auto;
    background: white;
    margin: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Table Styles */
.user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.user-table thead {
    background: #e8f5e9;
    position: sticky;
    top: 0;
    z-index: 10;
}

.user-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #2e7d32;
    border-bottom: 2px solid #4CAF50;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.user-table th:hover {
    background: #c8e6c9;
}

.authority-header {
    text-align: center !important;
    background: #c8e6c9;
    border-left: 1px solid #4CAF50;
    border-right: 1px solid #4CAF50;
}

.sub-header th {
    font-size: 12px;
    padding: 8px;
    background: #f1f8e9;
    border-bottom: 1px solid #81c784;
    font-weight: normal;
}

.user-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
}

.user-table tbody tr:hover {
    background: #f5f5f5;
}

.even-row {
    background: #fafafa;
}

.odd-row {
    background: white;
}

/* Cell Styles */
.user-id {
    font-weight: 600;
    color: #666;
    text-align: center;
}

.user-name {
    color: #333;
    font-weight: 500;
}

.user-role {
    padding: 4px 8px;
    display: inline-block;
}

.user-role:contains("admin") {
    color: #d32f2f;
    font-weight: 600;
}

.authority-cell {
    text-align: center;
    border-left: 1px solid #f0f0f0;
}

.checkmark {
    color: #4CAF50;
    font-size: 18px;
    font-weight: bold;
}

.user-email {
    color: #1976d2;
    font-size: 13px;
}

/* Sort Icon */
.sort-icon {
    display: inline-block;
    margin-left: 5px;
    color: #999;
    font-size: 12px;
}

/* Status Bar */
.user-status-bar {
    padding: 10px 20px;
    background: white;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #666;
}

/* Loading & Error States */
.loading-cell, .empty-cell, .error-cell {
    text-align: center;
    padding: 40px !important;
    color: #999;
    font-size: 14px;
}

.error-cell {
    color: #d32f2f;
}

.error-icon {
    font-size: 20px;
    margin-right: 8px;
}

/* Grid Action Buttons */
.action-grid-btn {
    padding: 8px 12px;
    margin: 0 4px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: white;
    transition: opacity 0.2s;
}

.action-grid-btn:hover {
    opacity: 0.9;
}

/* Inline Editable Cells */
.editable {
    cursor: pointer;
    position: relative;
}

.editable:hover {
    background-color: #f0f8ff;
}

.editable input,
.editable select {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #4CAF50;
    border-radius: 2px;
    font-size: inherit;
    font-family: inherit;
}

/* Date Column Styles */
.readonly-date {
    background-color: #f8f9fa;
    color: #666;
    font-size: 12px;
    text-align: center;
    font-family: monospace;
    padding: 8px 4px;
    cursor: help;
    border-left: 1px solid #e0e0e0;
}

.readonly-date:hover {
    background-color: #f0f0f0;
}

/* Row States */
.new-row {
    background-color: #e8f5e9 !important;
}

.new-row .readonly-date {
    background-color: #d4e8d4 !important;
    color: #999;
}

.deleted-row {
    text-decoration: line-through;
    opacity: 0.6;
    background-color: #ffebee !important;
}

.new-row td:first-child::before {
    content: "NEW";
    position: absolute;
    left: -30px;
    color: #4CAF50;
    font-size: 10px;
    font-weight: bold;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    min-width: 400px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
}

.modal-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    margin-bottom: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px 20px;
    border-top: 1px solid #e0e0e0;
}

.btn-primary,
.btn-secondary {
    padding: 10px 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #45a049;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background-color: #e9e9e9;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .user-search-input {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .user-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .user-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .user-table {
        font-size: 12px;
    }
    
    .user-table th, .user-table td {
        padding: 8px;
    }
    
    .modal-content {
        min-width: 300px;
        margin: 20px;
    }
    
    .checkbox-group {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }
}