/* Modal Styles */
.fid-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fidFadeIn 0.3s;
}

.fid-modal-content {
    background: #fff;
    margin: 5% auto;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fidSlideIn 0.3s;
}

.fid-modal-large {
    max-width: 1000px;
}

.fid-modal-small {
    max-width: 500px;
}

.fid-modal-header {
    padding: 20px 24px;
    border-bottom: 2px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 16px 16px 0 0;
}

.fid-modal-header h2 {
    margin: 0;
    color: #fff;
}

.fid-modal-close {
    font-size: 28px;
    cursor: pointer;
}

.fid-modal-body {
    padding: 24px;
}

/* Animations */
@keyframes fidFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Button Styles */
.fid-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
}

.fid-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.fid-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.fid-btn-secondary {
    background: #6c757d;
    color: #fff;
}

.fid-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.3);
}

/* Form Styles */
.fid-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.fid-form-group {
    flex: 1;
    min-width: 150px;
}

.fid-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    font-size: 13px;
    text-align: center;
}

.fid-form-group input,
.fid-form-group select,
.fid-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    height: 42px;
    line-height: 18px;
    box-sizing: border-box;
}

.fid-form-group textarea {
    height: auto;
    min-height: 80px;
    line-height: 1.5;
}

.fid-form-group input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.fid-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e8e8e8;
}

.fid-member-row {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.fid-icon-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.fid-icon-btn:hover {
    background: #f0f0f0;
    transform: scale(1.1);
}

.fid-btn-remove {
    background: #f44336;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.fid-btn-remove:hover {
    background: #e53935;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

/* Photo Upload Styles */
input[type='file'] {
    display: block;
    margin: 10px 0;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

input[type='file']:hover {
    border-color: #667eea;
    background: #f9f9f9;
}

#head-photo-preview,
#member-photo-preview {
    margin-top: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.fid-family-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 8px;
}

.fid-family-header img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Member Photo Styles */
.fid-table-mini td img {
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ddd;
    transition: transform 0.3s ease;
}

.fid-table-mini td img:hover {
    transform: scale(1.5);
    cursor: pointer;
}

.fid-table-mini td img[style*= width:50px] {
    width: 50px;
    height: 50px;
}

/* Family list photo column */
.fid-table tbody tr td:nth-child(2) img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ddd;
}

/* Photo Upload Enhancement */
.fid-photo-upload-wrapper {
    border: 2px dashed #667eea;
    border-radius: 8px;
    padding: 15px;
    background: linear-gradient(135deg, #f5f7ff 0%, #f0f4ff 100%);
    text-align: center;
    margin: 10px 0;
}

#member-photo-input,
input[name='head_photo'] {
    display: none;
}

.fid-photo-button {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
}

.fid-photo-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.fid-photo-button:active {
    transform: translateY(0);
}

.fid-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.fid-form-group input[type='text'],
.fid-form-group input[type='date'],
.fid-form-group input[type='email'],
.fid-form-group select,
.fid-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.fid-form-group input[type='text']:focus,
.fid-form-group input[type='date']:focus,
.fid-form-group input[type='email']:focus,
.fid-form-group select:focus,
.fid-form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Additional Photo Upload Styling */
.fid-form-group {
    margin-bottom: 15px;
    width: 100%;
}

.fid-photo-upload-wrapper {
    width: 100%;
    display: block;
}

#head-photo-input {
    display: none !important;
}

input[name='head_photo'] {
    display: none !important;
}

.fid-photo-button {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    font-size: 16px;
    text-align: center;
}

.fid-photo-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.fid-photo-upload-wrapper {
    width: 100% !important;
    border: 2px dashed #667eea !important;
    border-radius: 8px !important;
    padding: 20px 15px !important;
    background: linear-gradient(135deg, #f5f7ff 0%, #f0f4ff 100%) !important;
    text-align: center !important;
    margin: 15px 0 !important;
    display: block !important;
}

#head-photo-preview,
#member-photo-preview {
    max-width: 140px !important;
    height: auto !important;
    margin: 10px auto !important;
    display: block !important;
    border-radius: 8px !important;
    border: 2px solid #667eea !important;
}

.fid-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 600px) {
    .fid-form-row {
        grid-template-columns: 1fr;
    }
}

h3 {
    margin: 20px 0 15px 0;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

/* Mobile Responsive Dashboard Menu */
.fid-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.fid-logo {
    flex: 1;
    min-width: 250px;
}

.fid-logo h1 {
    margin: 0 0 8px 0;
    font-size: 28px;
    color: #333;
}

.fid-logo p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.fid-quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.fid-mobile-menu-toggle {
    display: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 18px;
    transition: all 0.3s;
    min-width: 50px;
}

.fid-mobile-menu-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.fid-menu-arrow {
    display: inline-block;
    transition: transform 0.3s;
    font-size: 16px;
}

.fid-menu-arrow.open {
    transform: rotate(180deg);
}

/* Mobile Menu Visibility */
.fid-quick-actions.collapsed {
    display: none !important;
}

.fid-quick-actions.expanded {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    gap: 8px;
}

.fid-quick-actions.expanded .fid-btn {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    font-size: 15px;
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    .fid-quick-actions {
        flex-wrap: wrap;
    }
    
    .fid-quick-actions .fid-btn {
        flex: 1;
        min-width: 150px;
        font-size: 13px;
        padding: 8px 12px;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .fid-dashboard-header {
        flex-direction: row;
        align-items: center;
        position: relative;
        flex-wrap: nowrap;
    }
    
    .fid-logo {
        flex: 1;
        min-width: 0;
    }
    
    .fid-logo h1 {
        font-size: 20px;
        margin-bottom: 4px;
    }
    
    .fid-logo p {
        font-size: 12px;
    }
    
    .fid-mobile-menu-toggle {
        display: block !important;
        flex-shrink: 0;
        padding: 10px 14px;
        font-size: 16px;
    }
    
    .fid-quick-actions {
        display: none !important;
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        gap: 8px;
        padding: 15px;
        border: 2px solid #667eea;
        border-radius: 8px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
        z-index: 10000;
        width: auto;
        min-width: 220px;
        margin: 0;
    }
    
    .fid-quick-actions.expanded {
        display: flex !important;
    }
    
    .fid-quick-actions.collapsed {
        display: none !important;
    }
    
    .fid-quick-actions .fid-btn {
        width: 100%;
        text-align: center;
        padding: 12px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .fid-dashboard-header {
        gap: 10px;
    }
    
    .fid-logo h1 {
        font-size: 18px;
        margin-bottom: 2px;
    }
    
    .fid-logo p {
        font-size: 11px;
    }
    
    .fid-mobile-menu-toggle {
        padding: 8px 12px;
        font-size: 14px;
        min-width: auto;
    }
    
    .fid-quick-actions {
        padding: 10px 12px;
        gap: 6px;
    }
    
    .fid-quick-actions .fid-btn {
        padding: 10px 12px;
        font-size: 12px;
    }
}
