/**
 * My Group Manager - Styles
 */

.mgm-container * {
    box-sizing: border-box;
}

.mgm-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 1200px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* TABS */
.mgm-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.mgm-tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.3s;
    font-weight: 500;
}

.mgm-tab-btn:hover {
    color: #667eea;
}

.mgm-tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.mgm-tab-content {
    display: none;
}

.mgm-tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mgm-tab-content h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
}

/* BUTTONS */
.mgm-btn-primary,
.mgm-btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    margin-bottom: 15px;
}

.mgm-btn-primary {
    background: #667eea;
    color: white;
}

.mgm-btn-primary:hover {
    background: #5568d3;
}

.mgm-btn-secondary {
    background: #6c757d;
    color: white;
}

.mgm-btn-secondary:hover {
    background: #5a6268;
}

.mgm-btn-primary:disabled,
.mgm-btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* LIST ITEMS */
.mgm-list {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.mgm-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    transition: all 0.3s;
}

.mgm-item:hover {
    background: #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mgm-item-content {
    flex: 1;
    min-width: 200px;
}

.mgm-item-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 16px;
}

.mgm-item-subtitle {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
}

.mgm-item small {
    color: #999;
    font-size: 12px;
}

.mgm-item-actions {
    display: flex;
    gap: 8px;
}

.mgm-item-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    background: #667eea;
    color: white;
    transition: all 0.3s;
}

.mgm-item-actions button:hover {
    background: #5568d3;
}

.mgm-item-actions button.delete {
    background: #dc3545;
}

.mgm-item-actions button.delete:hover {
    background: #c82333;
}

/* MODALS */
.mgm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.mgm-modal.show {
    display: flex;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mgm-modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.mgm-modal-content h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
}

/* FORM INPUTS */
.mgm-input,
.mgm-textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.mgm-input:focus,
.mgm-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.mgm-textarea {
    resize: vertical;
}

/* MODAL BUTTONS */
.mgm-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.mgm-modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.mgm-modal-buttons .mgm-btn-primary {
    background: #667eea;
    color: white;
    margin: 0;
}

.mgm-modal-buttons .mgm-btn-primary:hover {
    background: #5568d3;
}

.mgm-modal-buttons .mgm-btn-secondary {
    background: #e9ecef;
    color: #333;
    margin: 0;
}

.mgm-modal-buttons .mgm-btn-secondary:hover {
    background: #dee2e6;
}

/* STATUS BADGES */
.mgm-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #e9ecef;
    color: #666;
}

.mgm-status.not-posted {
    background: #e9ecef;
    color: #666;
}

.mgm-status.reply {
    background: #cfe2ff;
    color: #084298;
}

.mgm-status.posted {
    background: #d4edda;
    color: #155724;
}

.mgm-status.responded {
    background: #fff3cd;
    color: #664d03;
}

.mgm-status.opportunity {
    background: #f8d7da;
    color: #842029;
}

/* FOOTER */
.mgm-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.mgm-footer button {
    margin: 0 10px;
}

/* EMPTY STATE */
.mgm-list p {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .mgm-container {
        padding: 15px;
    }
    
    .mgm-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .mgm-tab-btn {
        padding: 10px 15px;
        font-size: 14px;
        white-space: nowrap;
    }
    
    .mgm-modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .mgm-item {
        flex-direction: column;
    }
    
    .mgm-item-actions {
        width: 100%;
    }
    
    .mgm-item-actions button {
        flex: 1;
    }
    
    .mgm-btn-primary,
    .mgm-btn-secondary {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* UTILITY */
.mgm-loading {
    opacity: 0.6;
    pointer-events: none;
}

.mgm-success {
    color: #155724;
    background: #d4edda;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.mgm-error {
    color: #842029;
    background: #f8d7da;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}
